Exception: Whoosh::Errors::HttpError
- Inherits:
-
WhooshError
- Object
- StandardError
- WhooshError
- Whoosh::Errors::HttpError
- Defined in:
- lib/whoosh/errors.rb
Direct Known Subclasses
ForbiddenError, NotFoundError, RateLimitExceeded, UnauthorizedError, ValidationError
Instance Attribute Summary collapse
-
#error_type ⇒ Object
readonly
Returns the value of attribute error_type.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(message = nil, status: 500, error_type: "internal_error") ⇒ HttpError
constructor
A new instance of HttpError.
- #to_h ⇒ Object
Constructor Details
#initialize(message = nil, status: 500, error_type: "internal_error") ⇒ HttpError
Returns a new instance of HttpError.
10 11 12 13 14 |
# File 'lib/whoosh/errors.rb', line 10 def initialize( = nil, status: 500, error_type: "internal_error") @status = status @error_type = error_type super( || error_type) end |
Instance Attribute Details
#error_type ⇒ Object (readonly)
Returns the value of attribute error_type.
8 9 10 |
# File 'lib/whoosh/errors.rb', line 8 def error_type @error_type end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
8 9 10 |
# File 'lib/whoosh/errors.rb', line 8 def status @status end |
Instance Method Details
#to_h ⇒ Object
16 17 18 |
# File 'lib/whoosh/errors.rb', line 16 def to_h { error: error_type } end |