Exception: Rescue::ApplicationError
- Inherits:
-
StandardError
- Object
- StandardError
- Rescue::ApplicationError
- Defined in:
- lib/rescue/exceptions/application_error.rb
Constant Summary collapse
- STATUS_CODES =
{ 40 => { http: 400, status: 'Invalid Request' }, 49 => { http: 400, status: 'Unsupported' }, 81 => { http: 401, status: 'Access Denied' }, 83 => { http: 401, status: 'Expired Token' }, 98 => { http: 403, status: 'Not Permitted' }, 99 => { http: 403, status: 'Suspended Account' }, 121 => { http: 410, status: 'Deleted Resources' }, 140 => { http: 429, status: 'Rate Limit Exceeded' }, 210 => { http: 500, status: 'Internal Error' }, 230 => { http: 503, status: 'Over Capacity' }, }
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#stauts ⇒ Object
Returns the value of attribute stauts.
Instance Method Summary collapse
-
#initialize(code, status, message = nil) ⇒ ApplicationError
constructor
A new instance of ApplicationError.
Constructor Details
#initialize(code, status, message = nil) ⇒ ApplicationError
Returns a new instance of ApplicationError.
20 21 22 23 24 |
# File 'lib/rescue/exceptions/application_error.rb', line 20 def initialize code, status, = nil @code = code @status = ( ? status : STATUS_CODES[code][:status]) @message = end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
17 18 19 |
# File 'lib/rescue/exceptions/application_error.rb', line 17 def code @code end |
#stauts ⇒ Object
Returns the value of attribute stauts.
18 19 20 |
# File 'lib/rescue/exceptions/application_error.rb', line 18 def stauts @stauts end |