Skip to content

Commit

Permalink
fix MatrixError signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
Half-Shot committed Sep 19, 2024
1 parent c48e4aa commit 903f8bb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion spec/integ/bridge.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {});
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/intent.spec.js
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/room-upgrade-handler.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 903f8bb

Please sign in to comment.