summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-10-04 15:43:01 +1100
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-10-04 15:43:01 +1100
commit63c0fbf62c5f7c9ffba4c366da60b71f047917b0 (patch)
treed1523ca4fa9f346191d60a15accd2d3ececa80eb /src/api
parentEmbed cache (diff)
downloadserver-63c0fbf62c5f7c9ffba4c366da60b71f047917b0.tar.xz
capture exception in sentry for embed processing
Diffstat (limited to 'src/api')
-rw-r--r--src/api/util/handlers/Message.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/api/util/handlers/Message.ts b/src/api/util/handlers/Message.ts
index e4b74f48..68fd37de 100644
--- a/src/api/util/handlers/Message.ts
+++ b/src/api/util/handlers/Message.ts
@@ -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;
 		}
 	}