Class: ShellEv::NotFoundException
- Inherits:
-
APIException
- Object
- CoreLibrary::ApiException
- APIException
- ShellEv::NotFoundException
- Defined in:
- lib/shell_ev/exceptions/not_found_exception.rb
Overview
Requested resource path not available it will provides the error in OpenAPI spec mentioned format, if there is any change in base URL then respective platform error message will be populated.
Instance Attribute Summary collapse
-
#errors ⇒ Array[NotFoundErrMsg]
Exception details of the error.
-
#request_id ⇒ String
requestId is unique identifier value that is attached to requests and messages that allow reference to a particular transaction or event chain.
-
#status ⇒ String
Status of the request.
Instance Method Summary collapse
-
#initialize(reason, response) ⇒ NotFoundException
constructor
The constructor.
-
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash.
Constructor Details
#initialize(reason, response) ⇒ NotFoundException
The constructor.
30 31 32 33 34 |
# File 'lib/shell_ev/exceptions/not_found_exception.rb', line 30 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
#errors ⇒ Array[NotFoundErrMsg]
Exception details of the error
25 26 27 |
# File 'lib/shell_ev/exceptions/not_found_exception.rb', line 25 def errors @errors end |
#request_id ⇒ String
requestId is unique identifier value that is attached to requests and messages that allow reference to a particular transaction or event chain.
17 18 19 |
# File 'lib/shell_ev/exceptions/not_found_exception.rb', line 17 def request_id @request_id end |
#status ⇒ String
Status of the request
21 22 23 |
# File 'lib/shell_ev/exceptions/not_found_exception.rb', line 21 def status @status end |
Instance Method Details
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/shell_ev/exceptions/not_found_exception.rb', line 39 def unbox(hash) @request_id = hash.key?('requestId') ? hash['requestId'] : SKIP @status = hash.key?('status') ? hash['status'] : SKIP # Parameter is an array, so we need to iterate through it @errors = nil unless hash['errors'].nil? @errors = [] hash['errors'].each do |structure| @errors << (NotFoundErrMsg.from_hash(structure) if structure) end end @errors = SKIP unless hash.key?('errors') end |