lib/hanami/middleware/body_parser/errors.rb in hanami-router-1.3.2 vs lib/hanami/middleware/body_parser/errors.rb in hanami-router-2.0.0.alpha1
- old
+ new
@@ -1,23 +1,26 @@
-require 'hanami/routing/error'
+# frozen_string_literal: true
module Hanami
module Middleware
# @since 1.3.0
# @api private
class BodyParser
# Body parsing error
# This is raised when parser fails to parse the body
#
# @since 1.3.0
- class BodyParsingError < Hanami::Routing::Parsing::BodyParsingError
+ class BodyParsingError < Hanami::Middleware::Error
end
# @since 1.3.0
- class UnknownParserError < Hanami::Routing::Parsing::UnknownParserError
+ class UnknownParserError < Hanami::Middleware::Error
+ def initialize(name)
+ super("Unknown body parser: `#{name.inspect}'")
+ end
end
- class InvalidParserError < Hanami::Routing::Error
+ class InvalidParserError < Hanami::Middleware::Error
end
end
end
end