Exception: Worldline::Acquiring::SDK::V1::ApiException
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Worldline::Acquiring::SDK::V1::ApiException
- Defined in:
- lib/worldline/acquiring/sdk/v1/api_exception.rb
Overview
Represents an error response from the Worldline Acquiring platform.
Direct Known Subclasses
AuthorizationException, PlatformException, ReferenceException, ValidationException
Instance Attribute Summary collapse
-
#detail ⇒ String
readonly
The detail received from the Worldline Acquiring platform if available.
-
#instance ⇒ String
readonly
The instance received from the Worldline Acquiring platform if available.
-
#response_body ⇒ String
readonly
Message body of the returned response.
-
#status ⇒ Integer
readonly
The status received from the Worldline Acquiring platform if available.
-
#status_code ⇒ Integer
readonly
HTTP status code of the returned response.
-
#title ⇒ String
readonly
The title received from the Worldline Acquiring platform if available.
-
#type ⇒ String
readonly
The type received from the Worldline Acquiring platform if available.
Instance Method Summary collapse
-
#initialize(status_code, response_body, type, title, status, detail, instance, message = 'The Worldline Acquiring platform returned an error response') ⇒ ApiException
constructor
Creates a new ApiException that reports an error response from the Worldline Acquiring platform.
- #to_s ⇒ Object
Constructor Details
#initialize(status_code, response_body, type, title, status, detail, instance, message = 'The Worldline Acquiring platform returned an error response') ⇒ ApiException
Creates a new ApiException that reports an error response from the Worldline Acquiring platform.
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/worldline/acquiring/sdk/v1/api_exception.rb', line 29 def initialize(status_code, response_body, type, title, status, detail, instance, ='The Worldline Acquiring platform returned an error response') super() @status_code = status_code @response_body = response_body @type = type @title = title @status = status @detail = detail @instance = instance end |
Instance Attribute Details
#detail ⇒ String (readonly)
The detail received from the Worldline Acquiring platform if available.
17 18 19 |
# File 'lib/worldline/acquiring/sdk/v1/api_exception.rb', line 17 def detail @detail end |
#instance ⇒ String (readonly)
The instance received from the Worldline Acquiring platform if available.
17 18 19 |
# File 'lib/worldline/acquiring/sdk/v1/api_exception.rb', line 17 def instance @instance end |
#response_body ⇒ String (readonly)
Message body of the returned response.
17 18 19 |
# File 'lib/worldline/acquiring/sdk/v1/api_exception.rb', line 17 def response_body @response_body end |
#status ⇒ Integer (readonly)
The status received from the Worldline Acquiring platform if available.
17 18 19 |
# File 'lib/worldline/acquiring/sdk/v1/api_exception.rb', line 17 def status @status end |
#status_code ⇒ Integer (readonly)
HTTP status code of the returned response.
17 18 19 |
# File 'lib/worldline/acquiring/sdk/v1/api_exception.rb', line 17 def status_code @status_code end |
#title ⇒ String (readonly)
The title received from the Worldline Acquiring platform if available.
17 18 19 |
# File 'lib/worldline/acquiring/sdk/v1/api_exception.rb', line 17 def title @title end |
#type ⇒ String (readonly)
The type received from the Worldline Acquiring platform if available.
17 18 19 |
# File 'lib/worldline/acquiring/sdk/v1/api_exception.rb', line 17 def type @type end |
Instance Method Details
#to_s ⇒ Object
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/worldline/acquiring/sdk/v1/api_exception.rb', line 49 def to_s str = super.to_s if @status_code > 0 str += '; status_code=' + @status_code.to_s end if !@response_body.nil? && @response_body.length > 0 str += "; response_body='" + @response_body + "'" end str.to_s end |