Skip to content

Improve DX around error handling #771

Description

@Totodore

Is your feature request related to a problem? Please describe.
Currently there is no clean/idiomatic way to handle errors in an handler. It appears that most people are ignoring errors, or wrapping them in a generic util fn.

Describe the solution you'd like
One of the possible ways to fix this would be to allow each hander to return Result<(), E: std::error::Error> so it is possible to use the ? to abort the rest of the handler in case of error. And maybe add an on_error closure.

Describe alternatives you've considered
We must explore other altertives before settling on this solution

Additional context
#770

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions