1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-09-20 01:31:34 +02:00

capture exception in sentry for embed processing

This commit is contained in:
Madeline 2022-10-04 15:43:01 +11:00
parent 83ed2c8fdd
commit 63c0fbf62c
No known key found for this signature in database
GPG Key ID: 1958E017C36F2E47
2 changed files with 7 additions and 1 deletions

View File

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

View File

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