Exception: Arkaan::Utils::Errors::HTTPError
- Inherits:
-
StandardError
- Object
- StandardError
- Arkaan::Utils::Errors::HTTPError
- Defined in:
- lib/virtuaservices/utils/errors/http_error.rb
Overview
Standard class parent to all specialized http errors.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#action ⇒ String
The name of the action the user was trying to perform on the model (often crate or update).
-
#error ⇒ String
The label of the error returned by the model.
-
#field ⇒ String, Symbol
The name of the field in error in the model.
-
#status ⇒ Integer
The HTTP status code as a number (eg: 400, 422 or 500).
Instance Method Summary collapse
-
#initialize(action, field, error, status) ⇒ HTTPError
constructor
A new instance of HTTPError.
Constructor Details
#initialize(action, field, error, status) ⇒ HTTPError
Returns a new instance of HTTPError.
21 22 23 24 25 26 |
# File 'lib/virtuaservices/utils/errors/http_error.rb', line 21 def initialize (action, field, error, status) @action = action @field = field.to_s @error = error @status = status end |
Instance Attribute Details
#action ⇒ String
Returns the name of the action the user was trying to perform on the model (often crate or update).
13 14 15 |
# File 'lib/virtuaservices/utils/errors/http_error.rb', line 13 def action @action end |
#error ⇒ String
Returns the label of the error returned by the model.
16 17 18 |
# File 'lib/virtuaservices/utils/errors/http_error.rb', line 16 def error @error end |
#field ⇒ String, Symbol
Returns the name of the field in error in the model.
10 11 12 |
# File 'lib/virtuaservices/utils/errors/http_error.rb', line 10 def field @field end |
#status ⇒ Integer
Returns the HTTP status code as a number (eg: 400, 422 or 500).
19 20 21 |
# File 'lib/virtuaservices/utils/errors/http_error.rb', line 19 def status @status end |