From 903f8bb64ad27b74b9f655b4d623293fdd439854 Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Thu, 19 Sep 2024 13:54:37 +0100 Subject: [PATCH] fix MatrixError signatures --- spec/integ/bridge.spec.js | 2 +- spec/unit/intent.spec.js | 2 +- spec/unit/room-upgrade-handler.spec.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/integ/bridge.spec.js b/spec/integ/bridge.spec.js index f242565b..52b17d8e 100644 --- a/spec/integ/bridge.spec.js +++ b/spec/integ/bridge.spec.js @@ -827,7 +827,7 @@ describe("Bridge", function() { const mxUser = new MatrixUser("@foo:example.com"); const intent = bridge.getIntent(mxUser.getId()); const botClient = intent.botSdkIntent; - const err = new MatrixError({ errcode: "M_FORBIDDEN" }); + const err = new MatrixError({ errcode: "M_FORBIDDEN" }, 401, {}); const errorPromise = Promise.reject(err); // This complains otherwise. errorPromise.catch((ex) => {}); diff --git a/spec/unit/intent.spec.js b/spec/unit/intent.spec.js index 37b5b39b..a692d938 100644 --- a/spec/unit/intent.spec.js +++ b/spec/unit/intent.spec.js @@ -1,6 +1,6 @@ const { Intent } = require("../.."); const { MatrixError } = require('@vector-im/matrix-bot-sdk'); -const matrixError = async (errcode, error) => { throw new MatrixError({errcode, error}, 500)}; +const matrixError = async (errcode, error) => { throw new MatrixError({errcode, error}, 500, {})}; describe("Intent", function() { let intent, botIntent, client, botClient, underlyingClient; diff --git a/spec/unit/room-upgrade-handler.spec.js b/spec/unit/room-upgrade-handler.spec.js index 66d351b5..207c444b 100644 --- a/spec/unit/room-upgrade-handler.spec.js +++ b/spec/unit/room-upgrade-handler.spec.js @@ -36,7 +36,7 @@ describe("RoomUpgradeHandler", () => { let joined; const bridge = { getIntent: () => ({ - join: async (roomId) => { joined = roomId; throw new MatrixError({errcode: "M_FORBIDDEN"}); }, + join: async (roomId) => { joined = roomId; throw new MatrixError({errcode: "M_FORBIDDEN"}, 401, {}); }, }), }; const ruh = new RoomUpgradeHandler({}, bridge); @@ -92,7 +92,7 @@ describe("RoomUpgradeHandler", () => { let joined; const bridge = { getIntent: () => ({ - join: async (roomId) => { joined = roomId; throw new MatrixError({errcode: "M_FORBIDDEN"}); }, + join: async (roomId) => { joined = roomId; throw new MatrixError({errcode: "M_FORBIDDEN"}, 401, {}); }, }), }; const ruh = new RoomUpgradeHandler({}, bridge);