Class: Veryfi::Error

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

Defined Under Namespace

Classes: AccessLimitReached, BadRequest, InternalError, UnauthorizedAccessToken, UnexpectedHTTPMethod

Class Method Summary collapse

Class Method Details

.from_response(response) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/veryfi/error.rb', line 5

def self.from_response(response)
  case response.status
  when 400 then BadRequest
  when 401 then UnauthorizedAccessToken
  when 405 then UnexpectedHTTPMethod
  when 409 then AccessLimitReached
  else InternalError
  end
end