Exception: Ruact::ActionError
- Defined in:
- lib/ruact/errors.rb
Overview
Story 8.3 — raised inside a standalone server-action block to surface a non-2xx response without calling ‘render` (which the StandaloneContext does not expose). The endpoint dispatcher rescues this exception class and renders `status` + `body` verbatim, mirroring how a controller-hosted action would call `render(json: …, status: …)`.
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(status:, body: nil, message: nil) ⇒ ActionError
constructor
A new instance of ActionError.
Constructor Details
#initialize(status:, body: nil, message: nil) ⇒ ActionError
Returns a new instance of ActionError.
59 60 61 62 63 |
# File 'lib/ruact/errors.rb', line 59 def initialize(status:, body: nil, message: nil) @status = status @body = body super( || "ruact action error (status=#{status.inspect})") end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
52 53 54 |
# File 'lib/ruact/errors.rb', line 52 def body @body end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
52 53 54 |
# File 'lib/ruact/errors.rb', line 52 def status @status end |