Exception: Micky::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Micky::Error
- Defined in:
- lib/micky/errors.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(message = nil, exception: nil, response: nil) ⇒ Error
constructor
A new instance of Error.
- #message ⇒ Object
- #request_uri ⇒ Object
- #response_code ⇒ Object
- #response_message ⇒ Object
Constructor Details
#initialize(message = nil, exception: nil, response: nil) ⇒ Error
Returns a new instance of Error.
5 6 7 8 9 |
# File 'lib/micky/errors.rb', line 5 def initialize( = nil, exception: nil, response: nil) @exception = exception @response = response @message = end |
Instance Attribute Details
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
3 4 5 |
# File 'lib/micky/errors.rb', line 3 def exception @exception end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
3 4 5 |
# File 'lib/micky/errors.rb', line 3 def response @response end |
Instance Method Details
#message ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/micky/errors.rb', line 11 def if response "#{response_code} #{} at #{request_uri}" elsif exception exception.inspect elsif @message @message else super end end |
#request_uri ⇒ Object
23 24 25 |
# File 'lib/micky/errors.rb', line 23 def request_uri response.uri if response end |
#response_code ⇒ Object
27 28 29 |
# File 'lib/micky/errors.rb', line 27 def response_code response.code.to_i if response end |
#response_message ⇒ Object
31 32 33 |
# File 'lib/micky/errors.rb', line 31 def response. if response end |