Exception: RocketPants::InvalidResource
- Defined in:
- lib/rocket_pants/errors.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Errors are ActiveModel Errors.
Instance Method Summary collapse
- #context ⇒ Object
-
#initialize(errors, *args) ⇒ InvalidResource
constructor
A new instance of InvalidResource.
Methods inherited from Error
error_name, #error_name, http_status, #http_status
Constructor Details
#initialize(errors, *args) ⇒ InvalidResource
Returns a new instance of InvalidResource.
70 71 72 73 |
# File 'lib/rocket_pants/errors.rb', line 70 def initialize(errors, *args) @errors = errors super *args end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Errors are ActiveModel Errors
68 69 70 |
# File 'lib/rocket_pants/errors.rb', line 68 def errors @errors end |
Instance Method Details
#context ⇒ Object
75 76 77 78 79 80 |
# File 'lib/rocket_pants/errors.rb', line 75 def context super.tap do |ctx| extras = (ctx[:metadata] ||= {}) extras[:messages] = errors.to_hash if errors end end |