Method: DotloopApi::CodeMap.call

Defined in:
lib/dotloop_api/exceptions.rb

.call(code) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/dotloop_api/exceptions.rb', line 13

def self.call(code)
  return if code == 200
  {
    400 => DotloopApi::BadRequest,
    401 => DotloopApi::Unauthorized,
    403 => DotloopApi::Forbidden,
    404 => DotloopApi::NotFound,
    422 => DotloopApi::UnprocessableEntity,
    429 => DotloopApi::TooManyRequests
  }.fetch(code, StandardError)
end