simmsb/calamity

Check failure reason reporting

Closed this issue · 2 comments

csamak commented

When command checks fail, is there any way to surface the message from the Maybe Text?

Failures can of course be reported/logged from within the checks, but some e.g. debug logging would be convenient, especially when using requiresPure.

simmsb commented

If a check fails it rises as a CustomEvt (CtxCommandError <your chosen context>) event, then you can log it like here: https://github.com/simmsb/calamity/blob/master/bot/app/Main.hs#L180

csamak commented

Makes sense. I missed that, thanks!