4 ms·
Careful before using LWT, it produces unhelpful stacktraces that just show the thread starting point instead of the actual running code. I have some production
by nraynaud 8y ago
Careful before using LWT, it produces unhelpful stacktraces that just show the thread starting point instead of the actual running code. I have some production stacktraces where I have to guess where the error lie while the customer's backup are in danger.
- Drup 8y agoThis 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.