Exception: Tango::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Tango::Error
- Defined in:
- lib/tango/error.rb
Direct Known Subclasses
Defined Under Namespace
Classes: ClientError, DecodeError, InsFunds, InsInv, InvCredential, InvInput, ServerError, SysError
Instance Attribute Summary collapse
-
#status_code ⇒ Object
Returns the value of attribute status_code.
Class Method Summary collapse
-
.from_status_code(status_code) ⇒ Tango::Error
Creates a new Error object from status_code.
Instance Method Summary collapse
- #backtrace ⇒ Object
-
#initialize(exception = $!) ⇒ Tango::Error
constructor
Initializes a new Error object.
Constructor Details
#initialize(exception = $!) ⇒ Tango::Error
Initializes a new Error object
19 20 21 22 |
# File 'lib/tango/error.rb', line 19 def initialize(exception = $!) @wrapped_exception = exception exception.respond_to?(:backtrace) ? super(exception.) : super(exception.to_s) end |
Instance Attribute Details
#status_code ⇒ Object
Returns the value of attribute status_code.
3 4 5 |
# File 'lib/tango/error.rb', line 3 def status_code @status_code end |
Class Method Details
.from_status_code(status_code) ⇒ Tango::Error
Creates a new Error object from status_code
9 10 11 12 13 |
# File 'lib/tango/error.rb', line 9 def self.from_status_code(status_code) ex = new("Error: #{status_code}") ex.status_code = status_code ex end |
Instance Method Details
#backtrace ⇒ Object
24 25 26 |
# File 'lib/tango/error.rb', line 24 def backtrace @wrapped_exception.respond_to?(:backtrace) ? @wrapped_exception.backtrace : super end |