If a command triggers an error back to the user and sending that
error raises an exception, log it and continue to avoid crashing the
engine.
import random
import re
+import traceback
import unicodedata
import mudpy
else:
message = "Arglebargle, glop-glyf!?!"
- # send the error message
- actor.send(message)
+ # try to send the error message, and log if we can't
+ try:
+ actor.send(message)
+ except Exception:
+ mudpy.misc.log(
+ 'Sending a command error to user %s raised exception...\n%s' % (
+ actor.owner.account.get("name"), traceback.format_exc()))
def halt(actor, parameters):