Exception: Shaf::Errors::UnsupportedMediaTypeError
- Inherits:
-
ServerError
- Object
- StandardError
- Shaf::Error
- ServerError
- Shaf::Errors::UnsupportedMediaTypeError
- Defined in:
- lib/shaf/errors.rb
Instance Attribute Summary
Attributes inherited from ServerError
Instance Method Summary collapse
- #http_status ⇒ Object
-
#initialize(msg = nil, request: nil) ⇒ UnsupportedMediaTypeError
constructor
A new instance of UnsupportedMediaTypeError.
Constructor Details
#initialize(msg = nil, request: nil) ⇒ UnsupportedMediaTypeError
Returns a new instance of UnsupportedMediaTypeError.
94 95 96 97 98 |
# File 'lib/shaf/errors.rb', line 94 def initialize(msg = nil, request: nil) content_type = request&.env["CONTENT_TYPE"] msg = "Unsupported Media Type#{content_type ? ": #{content_type}" : ""}" super(msg, code: "UNSUPPORTED_MEDIA_TYPE", title: "Unsupported media type") end |
Instance Method Details
#http_status ⇒ Object
90 91 92 |
# File 'lib/shaf/errors.rb', line 90 def http_status 415 end |