Added more verbose error logging to cmdset loading.

This commit is contained in:
Griatch 2014-10-22 23:47:59 +02:00
parent 7a9e738156
commit 671c541a1c

View file

@ -123,16 +123,20 @@ def import_cmdset(path, cmdsetobj, emit_to_obj=None, no_logging=False):
cmdsetclass = cmdsetclass(cmdsetobj)
return cmdsetclass
except ImportError, e:
logger.log_trace()
errstring += _("Error loading cmdset '%s': %s.")
errstring = errstring % (modulepath, e)
except KeyError:
logger.log_trace()
errstring += _("Error in loading cmdset: No cmdset class '%(classname)s' in %(modulepath)s.")
errstring = errstring % {"classname": classname,
"modulepath": modulepath}
except SyntaxError, e:
logger.log_trace()
errstring += _("SyntaxError encountered when loading cmdset '%s': %s.")
errstring = errstring % (modulepath, e)
except Exception, e:
logger.log_trace()
errstring += _("Compile/Run error when loading cmdset '%s': %s.")
errstring = errstring % (python_path, e)