Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If a event chain is halted, it fires the 'V:eventsHalted' event. That can be handled so that the default error handling does not kick in and you can handle it yourself. The post was issuing a multi-part post with body. That is a malformed request and starting with Rack 2.2.2 will generate an exception. rack/rack#1603 This fixes that issue.
- Loading branch information
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Voom::Presenters.define(:halted) do | ||
helpers Demo::Helpers::IndentedGrid | ||
attach :top_nav | ||
attach :events_drawer | ||
|
||
indented_grid do | ||
display 'Halted Events' | ||
body 'This demonstrates how to respond to failed, or halted events' | ||
|
||
content do | ||
button :failed_post do | ||
event :click do | ||
posts '_echo_', status: 500 | ||
end | ||
event 'V:eventsHalted' do | ||
snackbar 'That did not work! Please try again later.' | ||
end | ||
end | ||
|
||
end | ||
end | ||
attach :code, file: __FILE__ | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters