Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors from the actions are consumed without any messages #29

Open
qnikst opened this issue Jul 7, 2020 · 0 comments
Open

Errors from the actions are consumed without any messages #29

qnikst opened this issue Jul 7, 2020 · 0 comments

Comments

@qnikst
Copy link
Contributor

qnikst commented Jul 7, 2020

Currently all the errors from the telegram server (ones that runClietM is returned with) are consumed without any trace. It's very inconvenient to debug the bot in this setting. For the local debugging I've added:

 processActionsIndefinitely botApp botEnv = forkIO . forever $ do
-  runClientM (processActionJob botApp botEnv) (botClientEnv botEnv)
+  runClientM (processActionJob botApp botEnv) (botClientEnv botEnv) >>= \case
+     Right x -> pure ()
+     Left e -> print e

That at least logs the results so it's possible to see what has gone wrong. But ideally there should be some better solution, like installing own exception handler. Also it would be nice to be able to catch such exceptions from the actions, for example if bot resends a message that could fail due to the bad markup and we want to send an totally escaped message in case of a error, or implement clever retry.

I can contribute an implementation if we agree on the design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant