Exception: Ponominalu::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Ponominalu::Error
- Defined in:
- lib/ponominalu/error.rb
Overview
An exception raised by ‘Ponominalu::Response` when given a response with an error.
Instance Attribute Summary collapse
-
#error_code ⇒ Fixnum
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.
9 10 11 12 13 14 15 |
# File 'lib/ponominalu/error.rb', line 9 def initialize(data) @error_code = data.code @error_msg = data. @method_name = data.method_name @session = data.session @params = data.params end |
Instance Attribute Details
#error_code ⇒ Fixnum (readonly)
An error code.
6 7 8 |
# File 'lib/ponominalu/error.rb', line 6 def error_code @error_code end |
Instance Method Details
#message ⇒ String
A full description of the error.
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/ponominalu/error.rb', line 19 def = "Ponominalu returned an error #{@error_code}: '#{@error_msg}'"\ " after calling method '#{@method_name}'" if (@params.empty?) << " without parameters." else << " with parameters #{@params.inspect}." end << " App session is '#{@session}'." end |