Remove Result<_, InteractError> from interact signature #365
Labels
A-diesel
Area: Diesel / deadpool-diesel
A-r2d2
Area: rd2d / deadpool-r2d2
A-sqlite
Area: SQLite / deadpool-sqlite
discussion
enhancement
New feature or request
quality of life
Improvements to the API resulting in a better quality of life for the users of deadpool.
The return type of
interact
is questionable at best:InteractError::Panic
is dangerous to ignoreInteractError::Aborted
will never be created when using theSyncWrapper
interfaceI'm proposing to remove this Result from the call signature
What happens in the error cases?
It just panics. 💥
Why is this a good thing?
I think most users of the library will just log an error and ignore the
InteractError
anyways. The default behavior should be to escalate the error rather than trying to handle it "gracefully".For those people that really know what they're doing and need to handle panics an additional
interact_safe
could be added which does behave exactly like before.I'm interested to hear from users of this library if they ever had a need for handling a panic (or abortion) after an interact call.
The text was updated successfully, but these errors were encountered: