Exception: WorkOS::WorkOSError
- Inherits:
-
StandardError
- Object
- StandardError
- WorkOS::WorkOSError
- Extended by:
- T::Sig
- Defined in:
- lib/workos/errors.rb
Overview
Parent class for WorkOS related errors
Direct Known Subclasses
Instance Attribute Summary collapse
-
#http_status ⇒ Object
readonly
Returns the value of attribute http_status.
-
#request_id ⇒ Object
readonly
Returns the value of attribute request_id.
Instance Method Summary collapse
-
#initialize(message: nil, http_status: nil, request_id: nil) ⇒ WorkOSError
constructor
A new instance of WorkOSError.
- #to_s ⇒ Object
Constructor Details
#initialize(message: nil, http_status: nil, request_id: nil) ⇒ WorkOSError
Returns a new instance of WorkOSError.
20 21 22 23 24 |
# File 'lib/workos/errors.rb', line 20 def initialize(message: nil, http_status: nil, request_id: nil) @message = @http_status = http_status @request_id = request_id end |
Instance Attribute Details
#http_status ⇒ Object (readonly)
Returns the value of attribute http_status.
10 11 12 |
# File 'lib/workos/errors.rb', line 10 def http_status @http_status end |
#request_id ⇒ Object (readonly)
Returns the value of attribute request_id.
11 12 13 |
# File 'lib/workos/errors.rb', line 11 def request_id @request_id end |
Instance Method Details
#to_s ⇒ Object
27 28 29 30 31 |
# File 'lib/workos/errors.rb', line 27 def to_s status_string = @http_status.nil? ? '' : "Status #{@http_status}, " id_string = @request_id.nil? ? '' : " - request ID: #{@request_id}" "#{status_string}#{@message}#{id_string}" end |