Exception: WorkOS::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/workos/errors.rb

Overview

Base class for all SDK errors.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message:, http_status: nil, request_id: nil, code: nil, body: nil) ⇒ Error

Returns a new instance of Error.



9
10
11
12
13
14
15
# File 'lib/workos/errors.rb', line 9

def initialize(message:, http_status: nil, request_id: nil, code: nil, body: nil)
  super(message)
  @http_status = http_status
  @request_id = request_id
  @code = code
  @body = body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



7
8
9
# File 'lib/workos/errors.rb', line 7

def body
  @body
end

#codeObject (readonly)

Returns the value of attribute code.



7
8
9
# File 'lib/workos/errors.rb', line 7

def code
  @code
end

#http_statusObject (readonly)

Returns the value of attribute http_status.



7
8
9
# File 'lib/workos/errors.rb', line 7

def http_status
  @http_status
end

#request_idObject (readonly)

Returns the value of attribute request_id.



7
8
9
# File 'lib/workos/errors.rb', line 7

def request_id
  @request_id
end