mirror of
https://github.com/danbulant/flying-squid
synced 2026-07-06 11:40:46 +00:00
fix UserError checking
This commit is contained in:
parent
bccfc5d10c
commit
a12039e1bd
2 changed files with 2 additions and 1 deletions
|
|
@ -115,7 +115,7 @@ module.exports.player=function(player, serv) {
|
||||||
if (res) player.chat(serv.color.red + res);
|
if (res) player.chat(serv.color.red + res);
|
||||||
}
|
}
|
||||||
catch(err) {
|
catch(err) {
|
||||||
if (err instanceof UserError) player.chat(serv.color.red + 'Error: ' + err.message);
|
if (err.userError) player.chat(serv.color.red + 'Error: ' + err.message);
|
||||||
else setTimeout(() => {throw err;}, 0);
|
else setTimeout(() => {throw err;}, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ class ExtendableError extends Error {
|
||||||
|
|
||||||
class UserError extends ExtendableError {
|
class UserError extends ExtendableError {
|
||||||
constructor(message) {
|
constructor(message) {
|
||||||
|
this.userError=1;
|
||||||
super(message);
|
super(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue