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.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/hanami/action/errors.rb', line 37 def initialize(format) = <<~MSG Cannot find a corresponding MIME type for format `#{format.inspect}'. MSG unless blank?(format) += <<~MSG Configure one via: `config.actions.formats.add(:#{format}, "MIME_TYPE_HERE")' in `config/app.rb' to share between actions of a Hanami app. Or make it available only in the current action: `config.formats.add(:#{format}, "MIME_TYPE_HERE")'. MSG end super() end |