Correctly reference SocketlibInvalidUserError

This commit is contained in:
2021-04-20 12:21:17 +02:00
parent 2909bc16f5
commit 86b0162c9c
2 changed files with 8 additions and 2 deletions

View File

@@ -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.

View File

@@ -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]);
}