Exception: Shaf::Errors::ServerError
- Inherits:
-
StandardError
- Object
- StandardError
- Shaf::Errors::ServerError
- Defined in:
- lib/shaf/errors.rb
Direct Known Subclasses
BadRequestError, ForbiddenError, NotFoundError, UnauthorizedError, UnsupportedMediaTypeError
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.
10 11 12 13 14 |
# File 'lib/shaf/errors.rb', line 10 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.
4 5 6 |
# File 'lib/shaf/errors.rb', line 4 def code @code end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
4 5 6 |
# File 'lib/shaf/errors.rb', line 4 def title @title end |
Instance Method Details
#http_status ⇒ Object
6 7 8 |
# File 'lib/shaf/errors.rb', line 6 def http_status 500 end |