Exception Slacko.No_matches is not exposed in the API but may be raised
Khady opened this issue · comments
The function users_info
may raise an exception No_matches
if the user given as a parameter does not exist. As this exception is not exposed, it is not possible to catch it and apply a specific behaviour for it.
Am I missing something in the API?
In general I would like to avoid exceptions to propagate to client code, that's why there is the ``User_not_found` variant which should be returned instead.
It looks like I forgot to add the code that handles this failure altogether, I probably need to read https://ocsigen.org/lwt/dev/api/Lwt#2_Exceptionshandling and figure out how best to apply that in Slacko.
Can you give the isolate-lwt-exceptions branch a try? I reworked it so that it should catch the Lwt exceptions inside the code.
It works for me. No more exceptions. Thanks!