Exception: GH::Error
- Inherits:
-
Exception
- Object
- Exception
- GH::Error
- Defined in:
- lib/gh/error.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(error = nil, payload = nil) ⇒ Error
constructor
A new instance of Error.
- #message ⇒ Object
Constructor Details
#initialize(error = nil, payload = nil) ⇒ Error
Returns a new instance of Error.
11 12 13 14 15 |
# File 'lib/gh/error.rb', line 11 def initialize(error = nil, payload = nil) error = error.error while error.respond_to? :error @error, @payload = error, payload set_backtrace error.backtrace if error end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
5 6 7 |
# File 'lib/gh/error.rb', line 5 def error @error end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
5 6 7 |
# File 'lib/gh/error.rb', line 5 def payload @payload end |
Class Method Details
.new(error) ⇒ Object
7 8 9 |
# File 'lib/gh/error.rb', line 7 def self.new(error, *) Error === error ? error : super end |
Instance Method Details
#message ⇒ Object
17 18 19 |
# File 'lib/gh/error.rb', line 17 def "GH request failed (#{error.class}: #{error.}) with payload: #{short(payload.inspect)}" end |