Class: BacklogKit::Response::RaiseError

Inherits:
Middleware
  • Object
show all
Defined in:
lib/backlog_kit/response/raise_error.rb

Constant Summary collapse

CODE_ERRORS =
{
  1  => BacklogKit::InternalError,
  2  => BacklogKit::LicenceError,
  3  => BacklogKit::LicenceExpiredError,
  4  => BacklogKit::AccessDeniedError,
  5  => BacklogKit::UnauthorizedOperationError,
  6  => BacklogKit::NoResourceError,
  7  => BacklogKit::InvalidRequestError,
  8  => BacklogKit::SpaceOverCapacityError,
  9  => BacklogKit::ResourceOverflowError,
  10 => BacklogKit::TooLargeFileError,
  11 => BacklogKit::AuthenticationError
}.freeze

Instance Attribute Summary

Attributes inherited from Middleware

#body, #headers, #status

Instance Method Summary collapse

Instance Method Details

#on_complete(env) ⇒ Object

Raises:



20
21
22
23
# File 'lib/backlog_kit/response/raise_error.rb', line 20

def on_complete(env)
  super
  raise BacklogKit::Error, error_message unless success?
end