mirror of
https://github.com/danbulant/flying-squid
synced 2026-06-19 06:21:08 +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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ class ExtendableError extends Error {
|
|||
|
||||
class UserError extends ExtendableError {
|
||||
constructor(message) {
|
||||
this.userError=1;
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue