use try catch to guard against errors in commands
This commit is contained in:
parent
43327bbbe4
commit
c427956d0e
1 changed files with 11 additions and 1 deletions
|
|
@ -33,7 +33,17 @@ oop.inherits(CommandManager, HashHandler);
|
||||||
if (editor && editor.$readOnly && !command.readOnly)
|
if (editor && editor.$readOnly && !command.readOnly)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var retvalue = this._emit("exec", {editor: editor, command: command, args: args});
|
try {
|
||||||
|
var retvalue = this._emit("exec", {
|
||||||
|
editor: editor,
|
||||||
|
command: command,
|
||||||
|
args: args
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
window.console && window.console.log(e);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return retvalue === false ? false : true;
|
return retvalue === false ? false : true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue