Exception: Pechkin::AppError
- Inherits:
-
StandardError
- Object
- StandardError
- Pechkin::AppError
- Defined in:
- lib/pechkin/app/app_error.rb
Overview
Generic application error class.
Allows us return meaningful error messages
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(code, msg) ⇒ AppError
constructor
A new instance of AppError.
Constructor Details
#initialize(code, msg) ⇒ AppError
Returns a new instance of AppError.
8 9 10 11 |
# File 'lib/pechkin/app/app_error.rb', line 8 def initialize(code, msg) super(msg) @code = code end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
6 7 8 |
# File 'lib/pechkin/app/app_error.rb', line 6 def code @code end |
Class Method Details
.bad_request(message) ⇒ Object
14 15 16 |
# File 'lib/pechkin/app/app_error.rb', line 14 def bad_request() AppError.new(503, ) end |