From 86b0162c9cbd66f52d91a118a5723c035c491e02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20V=C3=B6gele?= Date: Tue, 20 Apr 2021 12:21:17 +0200 Subject: [PATCH] Correctly reference SocketlibInvalidUserError --- CHANGELOG.md | 6 ++++++ src/socketlib.js | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) 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]); }