Exception: Morpho::Exceptions::StandardError
- Inherits:
-
StandardError
- Object
- StandardError
- Morpho::Exceptions::StandardError
- Defined in:
- app/api/morpho/exceptions/standard_error.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(*args) ⇒ StandardError
constructor
A new instance of StandardError.
Constructor Details
#initialize(*args) ⇒ StandardError
Returns a new instance of StandardError.
8 9 10 11 12 13 14 15 16 |
# File 'app/api/morpho/exceptions/standard_error.rb', line 8 def initialize(*args) = args. @status = [:status] || 422 @message = [:message] || I18n.t("morpho.api.messages.general.#{@status}") @errors = [:errors] || {} super(@message) end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
6 7 8 |
# File 'app/api/morpho/exceptions/standard_error.rb', line 6 def errors @errors end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
5 6 7 |
# File 'app/api/morpho/exceptions/standard_error.rb', line 5 def @message end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'app/api/morpho/exceptions/standard_error.rb', line 4 def status @status end |