3 ms·
This probably means your code is wrong. You should not raise and catch exceptions normally in Lwt promises. You should use `Lwt.fail` and `Lwt.catch`. This is d
by Drup 8y ago
This probably means your code is wrong. You should not raise and catch exceptions normally in Lwt promises. You should use `Lwt.fail` and `Lwt.catch`. This is described rather precisely in the documentation: https://ocsigen.org/lwt/3.2.1/api/Lwt https://ocsigen.org/lwt/3.2.1/api/Lwt
Another popular solution in the OCaml community is to stop using exceptions and use Result instead: https://ocsigen.org/lwt/3.2.1/api/Lwt_result https://ocsigen.org/lwt/3.2.1/api/Lwt_result
- sgrove 8y agoLots of libraries we depend on throw exceptions, e.g. yojson, postgresql, or even just the stdlib (`Invalid_argument`, anyone?). Because the exceptions aren't statically shown at each usage point, it's hard to know what failure modes you should be watching for.
- nraynaud 8y agoit's not my code, it's there, I can only send PR and hope.