1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-10 12:42:44 +01:00

capture exception in sentry for embed processing

This commit is contained in:
Madeline 2022-10-04 15:43:01 +11:00
parent c885fd5503
commit 7db5c02189
2 changed files with 7 additions and 1 deletions

View File

@ -27,6 +27,7 @@ import {
import { HTTPError } from "lambert-server";
import { In } from "typeorm";
import { EmbedHandlers } from "@fosscord/api";
import * as Sentry from "@sentry/node";
const allow_empty = false;
// TODO: check webhook, application, system author, stickers
// TODO: embed gifs/videos/images
@ -219,6 +220,11 @@ export async function postHandleMessage(message: Message) {
}
}
catch (e) {
Sentry.captureException(e, scope => {
scope.clear();
scope.setContext("request", { url })
return scope;
});
continue;
}
}

View File

@ -53,7 +53,7 @@ export async function Message(this: WebSocket, buffer: WS.Data) {
try {
var ret = await OPCodeHandler.call(this, data);
// transaction.finish();
transaction.finish();
return ret;
} catch (error) {
Sentry.captureException(error);