Exception: Capsolver::ApiError

Inherits:
Error
  • Object
show all
Defined in:
lib/capsolver/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error_id:, error_code:, error_description:) ⇒ ApiError

Returns a new instance of ApiError.



9
10
11
12
13
14
# File 'lib/capsolver/error.rb', line 9

def initialize(error_id:, error_code:, error_description:)
  @error_id = error_id
  @error_code = error_code
  @error_description = error_description
  super("[#{error_code}] #{error_description} (Error ID: #{error_id})")
end

Instance Attribute Details

#error_codeObject (readonly)

Returns the value of attribute error_code.



7
8
9
# File 'lib/capsolver/error.rb', line 7

def error_code
  @error_code
end

#error_descriptionObject (readonly)

Returns the value of attribute error_description.



7
8
9
# File 'lib/capsolver/error.rb', line 7

def error_description
  @error_description
end

#error_idObject (readonly)

Returns the value of attribute error_id.



7
8
9
# File 'lib/capsolver/error.rb', line 7

def error_id
  @error_id
end