Exception: Services::SltcApiException
- Inherits:
-
StandardError
- Object
- StandardError
- Services::SltcApiException
- Defined in:
- app/models/services/sltc_api_exception.rb
Instance Attribute Summary collapse
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#error_message ⇒ Object
readonly
Returns the value of attribute error_message.
-
#error_response ⇒ Object
readonly
Returns the value of attribute error_response.
-
#inner_exception ⇒ Object
readonly
Returns the value of attribute inner_exception.
-
#raw_json ⇒ Object
readonly
Returns the value of attribute raw_json.
Instance Method Summary collapse
- #http_code ⇒ Object
- #http_message ⇒ Object
-
#initialize(exception) ⇒ SltcApiException
constructor
A new instance of SltcApiException.
Constructor Details
#initialize(exception) ⇒ SltcApiException
Returns a new instance of SltcApiException.
8 9 10 11 12 13 |
# File 'app/models/services/sltc_api_exception.rb', line 8 def initialize(exception) @inner_exception = exception @raw_json = exception.response if exception && exception.respond_to?(:response) @error_code = -1 super end |
Instance Attribute Details
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
6 7 8 |
# File 'app/models/services/sltc_api_exception.rb', line 6 def error_code @error_code end |
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
6 7 8 |
# File 'app/models/services/sltc_api_exception.rb', line 6 def @error_message end |
#error_response ⇒ Object (readonly)
Returns the value of attribute error_response.
6 7 8 |
# File 'app/models/services/sltc_api_exception.rb', line 6 def error_response @error_response end |
#inner_exception ⇒ Object (readonly)
Returns the value of attribute inner_exception.
5 6 7 |
# File 'app/models/services/sltc_api_exception.rb', line 5 def inner_exception @inner_exception end |
#raw_json ⇒ Object (readonly)
Returns the value of attribute raw_json.
6 7 8 |
# File 'app/models/services/sltc_api_exception.rb', line 6 def raw_json @raw_json end |
Instance Method Details
#http_code ⇒ Object
15 16 17 |
# File 'app/models/services/sltc_api_exception.rb', line 15 def http_code inner_exception.http_code if inner_exception && inner_exception.respond_to?(:http_code) end |
#http_message ⇒ Object
19 20 21 |
# File 'app/models/services/sltc_api_exception.rb', line 19 def inner_exception. if inner_exception && inner_exception.respond_to?(:message) end |