diff --git a/CHANGELOG.md b/CHANGELOG.md index 2059ee3..bb3d717 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## In development +### Bugfixes +- When an invalid user id is specified socketlib will now throw the correct error message. + + + ## 1.0.3 ### Bugfixes - `executeFor` functions will no longer fail with an exception if a function scheduled to be called by the local user throws. diff --git a/src/socketlib.js b/src/socketlib.js index 2ea426a..544813e 100644 --- a/src/socketlib.js +++ b/src/socketlib.js @@ -100,9 +100,9 @@ class SocketlibSocket { return func(...args); const user = game.users.get(userId); if (!user) - throw new SocketlibInvalidUserError(`No user with id '${userId}' exists.`); + throw new errors.SocketlibInvalidUserError(`No user with id '${userId}' exists.`); if (!user.active) - throw new SocketlibInvalidUserError(`User '${user.name}' (${userId}) is not connected.`); + throw new errors.SocketlibInvalidUserError(`User '${user.name}' (${userId}) is not connected.`); return this._sendRequest(name, args, [userId]); }