From 987854e9004a41892afd58239c6fbf2d16df7f86 Mon Sep 17 00:00:00 2001 From: iou1name Date: Fri, 31 Jan 2020 10:08:11 -0500 Subject: [PATCH] output error upon calc error --- modules/calc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/calc.py b/modules/calc.py index 0e3c365..4e17342 100755 --- a/modules/calc.py +++ b/modules/calc.py @@ -25,8 +25,8 @@ def c(bot, trigger): try: value = numexpr.evaluate(expr, local_dict={}, global_dict={}) value = value.item() - except: - value = "Error. The expression was not understood." + except Exception as e: + value = type(e).__name__ + ': ' + str(e) return_dict['value'] = value with multiprocessing.Manager() as manager: