class Shaf::Errors::UnsupportedMediaTypeError

Public Class Methods

new(msg = nil, request: nil) click to toggle source
Calls superclass method Shaf::Errors::ServerError::new
# 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

Public Instance Methods

http_status() click to toggle source
# File lib/shaf/errors.rb, line 90
def http_status
  415
end