Class: Batches::Batches502ErrorException
- Inherits:
-
APIException
- Object
- CoreLibrary::ApiException
- APIException
- Batches::Batches502ErrorException
- Defined in:
- lib/batches/exceptions/batches502_error_exception.rb
Overview
Bad Gateway
Instance Attribute Summary collapse
-
#detailed_error_code ⇒ DetailedErrorCode5
Unique reference to identify the error.
-
#detailed_error_description ⇒ String
Authentication error—Verify and correct credentials.
-
#error_code ⇒ ErrorCode5
This is an error indicating there was an issue connecting to a partner system..
Instance Method Summary collapse
-
#initialize(reason, response) ⇒ Batches502ErrorException
constructor
The constructor.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
-
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash.
Constructor Details
#initialize(reason, response) ⇒ Batches502ErrorException
The constructor.
28 29 30 31 32 |
# File 'lib/batches/exceptions/batches502_error_exception.rb', line 28 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
#detailed_error_code ⇒ DetailedErrorCode5
Unique reference to identify the error.
19 20 21 |
# File 'lib/batches/exceptions/batches502_error_exception.rb', line 19 def detailed_error_code @detailed_error_code end |
#detailed_error_description ⇒ String
Authentication error—Verify and correct credentials.
23 24 25 |
# File 'lib/batches/exceptions/batches502_error_exception.rb', line 23 def detailed_error_description @detailed_error_description end |
#error_code ⇒ ErrorCode5
This is an error indicating there was an issue connecting to a partner system..
15 16 17 |
# File 'lib/batches/exceptions/batches502_error_exception.rb', line 15 def error_code @error_code end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
55 56 57 58 59 60 |
# File 'lib/batches/exceptions/batches502_error_exception.rb', line 55 def inspect class_name = self.class.name.split('::').last "<#{class_name} error_code: #{@error_code.inspect}, detailed_error_code:"\ " #{@detailed_error_code.inspect}, detailed_error_description:"\ " #{@detailed_error_description.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
48 49 50 51 52 |
# File 'lib/batches/exceptions/batches502_error_exception.rb', line 48 def to_s class_name = self.class.name.split('::').last "<#{class_name} error_code: #{@error_code}, detailed_error_code: #{@detailed_error_code},"\ " detailed_error_description: #{@detailed_error_description}>" end |
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
37 38 39 40 41 42 43 44 45 |
# File 'lib/batches/exceptions/batches502_error_exception.rb', line 37 def unbox(hash) return nil unless hash @error_code = hash.key?('error_code') ? hash['error_code'] : SKIP @detailed_error_code = hash.key?('detailed_error_code') ? hash['detailed_error_code'] : SKIP @detailed_error_description = hash.key?('detailed_error_description') ? hash['detailed_error_description'] : SKIP end |