Exception: Shaf::Errors::ServerError
- Inherits:
-
Shaf::Error
- Object
- StandardError
- Shaf::Error
- Shaf::Errors::ServerError
- Defined in:
- lib/shaf/errors.rb
Direct Known Subclasses
BadRequestError, ConflictError, ForbiddenError, NotAcceptableError, NotFoundError, UnauthorizedError, UnprocessableEntityError, UnsupportedMediaTypeError, ValidationError
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #http_status ⇒ Object
-
#initialize(msg = "Unknown error", code: nil, title: nil) ⇒ ServerError
constructor
A new instance of ServerError.
Constructor Details
#initialize(msg = "Unknown error", code: nil, title: nil) ⇒ ServerError
Returns a new instance of ServerError.
12 13 14 15 16 |
# File 'lib/shaf/errors.rb', line 12 def initialize(msg = "Unknown error", code: nil, title: nil) super(msg) @code = code || "UNKNOWN_ERROR" @title = title || "Something bad happend" end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
6 7 8 |
# File 'lib/shaf/errors.rb', line 6 def code @code end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
6 7 8 |
# File 'lib/shaf/errors.rb', line 6 def title @title end |
Instance Method Details
#http_status ⇒ Object
8 9 10 |
# File 'lib/shaf/errors.rb', line 8 def http_status 500 end |