Exception: TelphinApi::Error
- Inherits:
-
StandardError
- Object
- StandardError
- TelphinApi::Error
- Defined in:
- lib/telphin_api/error.rb
Overview
An exception raised by TelphinApi::Result
when given a response with an error.
Instance Attribute Summary collapse
-
#error_code ⇒ String
readonly
An error code.
Instance Method Summary collapse
-
#initialize(data) ⇒ Error
constructor
An exception is initialized by the data from response mash.
-
#message ⇒ String
A full description of the error.
Constructor Details
#initialize(data) ⇒ Error
An exception is initialized by the data from response mash.
10 11 12 13 |
# File 'lib/telphin_api/error.rb', line 10 def initialize(data) @error_code = data.code @error_msg = data. end |
Instance Attribute Details
#error_code ⇒ String (readonly)
An error code.
6 7 8 |
# File 'lib/telphin_api/error.rb', line 6 def error_code @error_code end |
Instance Method Details
#message ⇒ String
A full description of the error.
17 18 19 |
# File 'lib/telphin_api/error.rb', line 17 def "Telphin returned an error #{@error_code}: '#{@error_msg}'" end |