lib/workos/errors.rb in workos-2.5.1 vs lib/workos/errors.rb in workos-2.6.0
- old
+ new
@@ -7,28 +7,42 @@
class WorkOSError < StandardError
extend T::Sig
attr_reader :http_status
attr_reader :request_id
+ attr_reader :code
+ attr_reader :errors
+ # rubocop:disable Metrics/ParameterLists
sig do
params(
message: T.nilable(String),
error: T.nilable(String),
error_description: T.nilable(String),
http_status: T.nilable(Integer),
request_id: T.nilable(String),
code: T.nilable(String),
+ errors: T.nilable(T::Array[T::Hash[T.untyped, T.untyped]]),
).void
end
- def initialize(message: nil, error: nil, error_description: nil, http_status: nil, request_id: nil, code: nil)
+ def initialize(
+ message: nil,
+ error: nil,
+ error_description: nil,
+ http_status: nil,
+ request_id: nil,
+ code: nil,
+ errors: nil
+ )
@message = message
@error = error
@error_description = error_description
@http_status = http_status
@request_id = request_id
@code = code
+ @errors = errors
end
+ # rubocop:enable Metrics/ParameterLists
sig { returns(String) }
def to_s
status_string = @http_status.nil? ? '' : "Status #{@http_status}, "
id_string = @request_id.nil? ? '' : " - request ID: #{@request_id}"