bot icon indicating copy to clipboard operation
bot copied to clipboard

Better error messages on uncaught exceptions

Open JasonGross opened this issue 2 years ago • 4 comments

I see things like

Error: Unhandled exception: (Invalid_argument Str.matched_group)

and similar messages for stack overflow (on logentries), and it would be nice to get a backtrace instead, so I can Can this be done?

JasonGross avatar Jan 23 '23 20:01 JasonGross

This message is generated here: https://github.com/coq/bot/blob/3deea7d3c044371cf5df92ae70a51ec4339071f8/src/bot.ml#L506-L511 Since we are not in a catch clause, I'm not sure that a backtrace would still be available. We could experiment with inserting Printexc.print_backtrace (and turning exception backtrace recording on, with Printexc.record_backtrace).

Zimmi48 avatar Feb 08 '23 16:02 Zimmi48

We should record backtraces since we are not performance critical anyway. Debugging coq bot is hard enough on its own, we should help any way we can.

Alizter avatar Feb 08 '23 16:02 Alizter

Since we do not use exception-based workflows in the bot codebase (except maybe catching a few Not_found here and there coming from external libraries), would this have any actual performance impact anyway?

Zimmi48 avatar Apr 16 '23 17:04 Zimmi48

@Zimmi48 Not for coqbot.

Alizter avatar Apr 17 '23 11:04 Alizter