Class: AthenaHealth::Error

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

Constant Summary collapse

ERROR_TYPES =
{
  401 => UnauthorizedError,
  402 => IncorrectPermissionsError,
  403 => ForbiddenError,
  404 => NotFoundError,
  500 => InternalServerError,
  503 => ServiceUnavailableError,
}

Instance Method Summary collapse

Constructor Details

#initialize(code:) ⇒ Error

Returns a new instance of Error.



28
29
30
# File 'lib/athena_health/error.rb', line 28

def initialize(code:)
  @code = code
end

Instance Method Details

#renderObject



32
33
34
# File 'lib/athena_health/error.rb', line 32

def render
  fail ERROR_TYPES[@code]
end