Exception: Railerr::APIException
- Inherits:
-
StandardError
- Object
- StandardError
- Railerr::APIException
- Defined in:
- lib/railerr/api_exceptions.rb
Overview
Base Exception class to raise exceptions associated with HTTP errors
Direct Known Subclasses
BadGatewayError, BadRequestError, ConflictError, ForbiddenError, GatewayTimeoutError, ImATeapotError, InternalServerError, LockedError, NotFoundError, RequestTimeoutError, ServiceUnavailableError, UnauthorizedError, UnprocessableContentError
Constant Summary collapse
- DEFAULT_MESSAGE =
'A server error occurred'
- STATUS_CODE =
Status::HTTP_500_INTERNAL_SERVER_ERROR
Instance Method Summary collapse
- #default_message ⇒ Object
-
#initialize(message = nil) ⇒ APIException
constructor
A new instance of APIException.
- #status_code ⇒ Object
Constructor Details
#initialize(message = nil) ⇒ APIException
Returns a new instance of APIException.
11 12 13 |
# File 'lib/railerr/api_exceptions.rb', line 11 def initialize( = nil) super( || ) end |
Instance Method Details
#default_message ⇒ Object
15 16 17 |
# File 'lib/railerr/api_exceptions.rb', line 15 def self.class::DEFAULT_MESSAGE end |
#status_code ⇒ Object
19 20 21 |
# File 'lib/railerr/api_exceptions.rb', line 19 def status_code self.class::STATUS_CODE end |