Exception: Grac::Exception::ErrorWithInvalidContent
- Inherits:
-
StandardError
- Object
- StandardError
- Grac::Exception::ErrorWithInvalidContent
- Defined in:
- lib/grac/exception.rb
Instance Attribute Summary collapse
-
#raw_body ⇒ Object
readonly
Returns the value of attribute raw_body.
Instance Method Summary collapse
-
#initialize(method, url, status, raw_body, expected_type) ⇒ ErrorWithInvalidContent
constructor
A new instance of ErrorWithInvalidContent.
- #inspect ⇒ Object
- #message ⇒ Object (also: #to_s)
Constructor Details
#initialize(method, url, status, raw_body, expected_type) ⇒ ErrorWithInvalidContent
Returns a new instance of ErrorWithInvalidContent.
85 86 87 88 89 90 91 |
# File 'lib/grac/exception.rb', line 85 def initialize(method, url, status, raw_body, expected_type) @method = (method || "").upcase @url = url @status = status @raw_body = raw_body @expected_type = expected_type end |
Instance Attribute Details
#raw_body ⇒ Object (readonly)
Returns the value of attribute raw_body.
83 84 85 |
# File 'lib/grac/exception.rb', line 83 def raw_body @raw_body end |
Instance Method Details
#inspect ⇒ Object
98 99 100 |
# File 'lib/grac/exception.rb', line 98 def inspect "#{self.class.name}: #{}" end |
#message ⇒ Object Also known as: to_s
93 94 95 96 |
# File 'lib/grac/exception.rb', line 93 def "#{@method} '#{@url}': Got HTTP #{@status}, failed to parse as '#{@expected_type}'. " \ "Raw Body: '#{@raw_body}'" end |