Lwtreslib: provide exception-catching functions
Context
We have multiple ways to deal with errors: result, tzresult, option, exception. Occasionally, we write code that bridges the gap between those different ways. (E.g., when we call a library that uses exceptions inside a function that uses results.)
Typical example: !2765 (comment 555727601)
This MR provides a few helper functions to smooth the transition between the different kinds of error management.
Manually testing the MR
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rst
for the protocol and the environment, theDevelopment Version
section ofCHANGES.md
for everything else). -
Select suitable reviewers using the Reviewers
field below.
Edited by Raphaël Proust