Exception: Grac::Exception::ErrorWithInvalidContent
- Inherits:
-
StandardError
- Object
- StandardError
- Grac::Exception::ErrorWithInvalidContent
- Defined in:
- lib/grac/exception.rb
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.
81 82 83 84 85 86 87 |
# File 'lib/grac/exception.rb', line 81 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 Method Details
#inspect ⇒ Object
94 95 96 |
# File 'lib/grac/exception.rb', line 94 def inspect "#{self.class.name}: #{}" end |
#message ⇒ Object Also known as: to_s
89 90 91 92 |
# File 'lib/grac/exception.rb', line 89 def "#{@method} '#{@url}': Got HTTP #{@status}, failed to parse as '#{@expected_type}'. " \ "Raw Body: '#{@raw_body}'" end |