Exception: Miscellany::HttpErrorHandling::HttpError
- Inherits:
-
StandardError
- Object
- StandardError
- Miscellany::HttpErrorHandling::HttpError
- Defined in:
- lib/miscellany/controller/http_error_handling.rb
Instance Attribute Summary collapse
-
#extra ⇒ Object
Returns the value of attribute extra.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(arg = nil, status: nil, message: '', **extra) ⇒ HttpError
constructor
A new instance of HttpError.
Constructor Details
#initialize(arg = nil, status: nil, message: '', **extra) ⇒ HttpError
Returns a new instance of HttpError.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/miscellany/controller/http_error_handling.rb', line 9 def initialize(arg = nil, status: nil, message: '', **extra) if arg.is_a?(Numeric) raise ArgumentError, ':status supplied multiple times' if status.present? status = arg elsif arg.present? raise ArgumentError, ':message supplied multiple times' if .present? = arg end super() @status = status @extra = extra end |
Instance Attribute Details
#extra ⇒ Object
Returns the value of attribute extra.
8 9 10 |
# File 'lib/miscellany/controller/http_error_handling.rb', line 8 def extra @extra end |
#status ⇒ Object
Returns the value of attribute status.
8 9 10 |
# File 'lib/miscellany/controller/http_error_handling.rb', line 8 def status @status end |