Exception: Raas::RaasGenericException
- Inherits:
-
APIException
- Object
- StandardError
- APIException
- Raas::RaasGenericException
- Defined in:
- lib/raas/exceptions/raas_generic_exception.rb
Overview
RaaS API Generic Exception
Instance Attribute Summary collapse
-
#http_code ⇒ Integer
HTTP Code.
-
#http_phrase ⇒ String
HTTP Phrase.
-
#message ⇒ String
Error Message.
-
#path ⇒ String
Request Path.
-
#request_id ⇒ String
Request ID.
-
#timestamp ⇒ DateTime
Request timestamp.
Attributes inherited from APIException
Instance Method Summary collapse
-
#initialize(reason, context) ⇒ RaasGenericException
constructor
The constructor.
-
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash.
Constructor Details
#initialize(reason, context) ⇒ RaasGenericException
The constructor.
35 36 37 38 39 |
# File 'lib/raas/exceptions/raas_generic_exception.rb', line 35 def initialize(reason, context) super(reason, context) hash = APIHelper.json_deserialize(@context.response.raw_body) unbox(hash) end |
Instance Attribute Details
#http_code ⇒ Integer
HTTP Code
22 23 24 |
# File 'lib/raas/exceptions/raas_generic_exception.rb', line 22 def http_code @http_code end |
#http_phrase ⇒ String
HTTP Phrase
26 27 28 |
# File 'lib/raas/exceptions/raas_generic_exception.rb', line 26 def http_phrase @http_phrase end |
#message ⇒ String
Error Message
30 31 32 |
# File 'lib/raas/exceptions/raas_generic_exception.rb', line 30 def @message end |
#path ⇒ String
Request Path
18 19 20 |
# File 'lib/raas/exceptions/raas_generic_exception.rb', line 18 def path @path end |
#request_id ⇒ String
Request ID
14 15 16 |
# File 'lib/raas/exceptions/raas_generic_exception.rb', line 14 def request_id @request_id end |
#timestamp ⇒ DateTime
Request timestamp
10 11 12 |
# File 'lib/raas/exceptions/raas_generic_exception.rb', line 10 def @timestamp end |
Instance Method Details
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
44 45 46 47 48 49 50 51 |
# File 'lib/raas/exceptions/raas_generic_exception.rb', line 44 def unbox(hash) @timestamp = APIHelper.rfc3339(hash['timestamp']) if hash['timestamp'] @request_id = hash['requestId'] @path = hash['path'] @http_code = hash['httpCode'] @http_phrase = hash['httpPhrase'] @message = hash['message'] end |