Leonidas-from-XIV / slacko

A neat interface for Slack

Home Page:https://leonidas-from-xiv.github.io/slacko

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exception Slacko.No_matches is not exposed in the API but may be raised

Khady opened this issue · comments

commented

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.

commented

Can you give the isolate-lwt-exceptions branch a try? I reworked it so that it should catch the Lwt exceptions inside the code.

commented

It works for me. No more exceptions. Thanks!