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(message = "An unexpected API error occurred", status, error, description) ⇒ ApiError

Returns a new instance of ApiError.



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

def initialize(message = "An unexpected API error occurred", status, error, description)
  @status      = status || 500
  @error       = error
  @description = description

  super(message)
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



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

def description
  @description
end

#errorObject (readonly)

Returns the value of attribute error.



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

def error
  @error
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end

Instance Method Details

#to_sObject



15
16
17
# File 'lib/authsignal/api_error.rb', line 15

def to_s
  "#{super} status: #{status}, error: #{error}, description: #{description}"
end