Exception: Whoosh::Errors::HttpError

Inherits:
WhooshError
  • Object
show all
Defined in:
lib/whoosh/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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(message = nil, status: 500, error_type: "internal_error")
  @status = status
  @error_type = error_type
  super(message || error_type)
end

Instance Attribute Details

#error_typeObject (readonly)

Returns the value of attribute error_type.



8
9
10
# File 'lib/whoosh/errors.rb', line 8

def error_type
  @error_type
end

#statusObject (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_hObject



16
17
18
# File 'lib/whoosh/errors.rb', line 16

def to_h
  { error: error_type }
end