sopel-irc / sopel

:robot::speech_balloon: An easy-to-use and highly extensible IRC Bot framework. Formerly Willie.
https://sopel.chat
Other
950 stars 405 forks source link

calc: gracefully handle `ExpressionEvaluator.Error` #2507

Closed dgw closed 9 months ago

dgw commented 10 months ago

Description

Replaced fallthrough to Sopel's bot-level "Unexpected Error" handler with a more graceful presentation of the error message.

Checklist

Notes

We might consider making this exception a standalone class, for less wacky-looking error handling in this and other consumers of the tools.calculation submodule. Doing except a_function.Subclass feels weird and wrong.