From aeb43b9bb1c0a98e16d91b10a5b3c121d84fd90c Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 22 Dec 2021 10:57:52 -0500 Subject: [PATCH] fix: rename language key for incorrect parameter type error --- public/language/en-GB/error.json | 2 +- src/api/chats.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/language/en-GB/error.json b/public/language/en-GB/error.json index eccd5d43d1..bf004cf7a3 100644 --- a/public/language/en-GB/error.json +++ b/public/language/en-GB/error.json @@ -1,7 +1,7 @@ { "invalid-data": "Invalid Data", "invalid-json": "Invalid JSON", - "array-expected": "A value of type Array was expected for property `%1`, but %2 was received instead", + "wrong-parameter-type": "A value of type %3 was expected for property `%1`, but %2 was received instead", "required-parameters-missing": "Required parameters were missing from this API call: %1", "not-logged-in": "You don't seem to be logged in.", diff --git a/src/api/chats.js b/src/api/chats.js index 0ab920aa42..67d2eabe5a 100644 --- a/src/api/chats.js +++ b/src/api/chats.js @@ -29,7 +29,7 @@ chatsAPI.create = async function (caller, data) { } if (!data.uids || !Array.isArray(data.uids)) { - throw new Error(`[[error:array-expected, uids, ${typeof data.uids}]]`); + throw new Error(`[[error:wrong-parameter-type, uids, ${typeof data.uids}, Array]]`); } await Promise.all(data.uids.map(async uid => messaging.canMessageUser(caller.uid, uid)));