Exception: Protocol::Content::UnsupportedMediaTypeError

Inherits:
Error
  • Object
show all
Defined in:
lib/protocol/content/error.rb

Overview

Raised when no parser accepts a media type.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(media_type) ⇒ UnsupportedMediaTypeError

Initialize the error.



24
25
26
27
28
29
30
31
32
# File 'lib/protocol/content/error.rb', line 24

def initialize(media_type)
	if media_type
		super("Unsupported media type: #{media_type}")
	else
		super("Missing media type!")
	end
	
	@media_type = media_type
end

Instance Attribute Details

#media_typeObject (readonly)

The unsupported media type, if one was provided.



35
36
37
# File 'lib/protocol/content/error.rb', line 35

def media_type
  @media_type
end