Exception: Hanami::Action::UnknownFormatError
- Defined in:
- lib/hanami/action/errors.rb
Overview
Unknown format error
This error is raised when a action sets a format that it isn’t recognized both by ‘Hanami::Action::Configuration` and the list of Rack mime types
Instance Method Summary collapse
-
#initialize(format) ⇒ UnknownFormatError
constructor
private
A new instance of UnknownFormatError.
Constructor Details
#initialize(format) ⇒ UnknownFormatError
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of UnknownFormatError.
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/hanami/action/errors.rb', line 23 def initialize(format) msg = if format.to_s != "" # rubocop:disable Style/NegatedIfElseCondition "Cannot find a corresponding MIME type for format #{format.inspect}. Configure one via `config.formats.add(#{format}: \"MIME_TYPE_HERE\")`." # rubocop:disable Layout/LineLength else "Cannot find a corresponding MIME type for `nil` format." end super(msg) end |