Exception: KazeClient::Error::Generic
- Defined in:
- lib/kaze_client/error/generic.rb
Overview
Generic error raised when Kaze server send an unknown error. By default, it is considered to be an internal server error.
Direct Known Subclasses
Forbidden, InternalServerError, NoEndpoint, NotFound, Unauthorized
Constant Summary collapse
- DEFAULT_MESSAGE =
The default error message
'An unknown error occured'
Instance Attribute Summary collapse
- #error ⇒ String, Symbol readonly
-
#status ⇒ Symbol
readonly
The HTTP status sent by the server.
Instance Method Summary collapse
-
#initialize(status: :internal_server_error, error: nil, message: DEFAULT_MESSAGE) ⇒ Generic
constructor
A new instance of Generic.
Constructor Details
#initialize(status: :internal_server_error, error: nil, message: DEFAULT_MESSAGE) ⇒ Generic
Returns a new instance of Generic.
23 24 25 26 27 28 29 |
# File 'lib/kaze_client/error/generic.rb', line 23 def initialize(status: :internal_server_error, error: nil, message: DEFAULT_MESSAGE) super( || DEFAULT_MESSAGE) @status = status || :internal_server_error @error = error || @status end |
Instance Attribute Details
#error ⇒ String, Symbol (readonly)
18 19 20 |
# File 'lib/kaze_client/error/generic.rb', line 18 def error @error end |
#status ⇒ Symbol (readonly)
Returns The HTTP status sent by the server.
14 15 16 |
# File 'lib/kaze_client/error/generic.rb', line 14 def status @status end |