diff --git a/common/content/events.js b/common/content/events.js index dce30d80..87dc2617 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -255,7 +255,17 @@ function AutoCommands() //{{{ liberator.echomsg("autocommand " + autoCmd.command, 9); if (typeof autoCmd.command == "function") - autoCmd.command.call(autoCmd, args); + { + try + { + autoCmd.command.call(autoCmd, args); + } + catch(e) + { + liberator.reportError(e); + liberator.echoerr(e); + } + } else liberator.execute(commands.replaceTokens(autoCmd.command, args)); }