Exception: Authsignal::ApiError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/authsignal/api_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status_code, error_code, error_description = nil) ⇒ ApiError

Returns a new instance of ApiError.



7
8
9
10
11
12
13
14
15
# File 'lib/authsignal/api_error.rb', line 7

def initialize(status_code, error_code, error_description = nil)
  message = format_message(status_code, error_code, error_description)

  super(message)

  @status_code = status_code
  @error_code = error_code
  @error_description = error_description
end

Instance Attribute Details

#error_codeObject (readonly)

Returns the value of attribute error_code.



5
6
7
# File 'lib/authsignal/api_error.rb', line 5

def error_code
  @error_code
end

#error_descriptionObject (readonly)

Returns the value of attribute error_description.



5
6
7
# File 'lib/authsignal/api_error.rb', line 5

def error_description
  @error_description
end

#status_codeObject (readonly)

Returns the value of attribute status_code.



5
6
7
# File 'lib/authsignal/api_error.rb', line 5

def status_code
  @status_code
end

Instance Method Details

#to_sObject



17
18
19
# File 'lib/authsignal/api_error.rb', line 17

def to_s
  "#{super} status_code: #{status_code}, error_code: #{error_code}, error_description: #{error_description}"
end