Provide normal error if command raises exception
authorJeremy Stanley <fungi@yuggoth.org>
Mon, 13 May 2019 19:23:51 +0000 (19:23 +0000)
committerJeremy Stanley <fungi@yuggoth.org>
Mon, 13 May 2019 19:39:52 +0000 (19:39 +0000)
If a attempting to execute a user-supplied command results in a
Python exception, return the normal error message string to the user
(in addition to logging the exception and traceback). This way,
normal users won't see any difference between unknown/invalid
commands and broken ones.

mudpy/misc.py

index f99fac3..63e4df4 100644 (file)
@@ -1911,6 +1911,7 @@ def handler_active(user):
                         'exception...\n%s' % (
                             input_data, actor.owner.account.get("name"),
                             traceback.format_exc()))
+                    mudpy.command.error(actor, input_data)
 
         # if the command was not run, give an error
         if not ran: