diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-10-30 11:33:27 +1100 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-10-30 11:34:25 +1100 |
commit | 45aadf327d7cd596e8a21e0ca1a19a7e9e6246ce (patch) | |
tree | e1e5b75c5d3c3914498b27f2c6037080ef4d578a /src/gateway/events/Message.ts | |
parent | Added fast connect to index (diff) | |
download | server-45aadf327d7cd596e8a21e0ca1a19a7e9e6246ce.tar.xz |
Sentry stuff?
Diffstat (limited to '')
-rw-r--r-- | src/gateway/events/Message.ts | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gateway/events/Message.ts b/src/gateway/events/Message.ts index 9fafae1e..4ed715b2 100644 --- a/src/gateway/events/Message.ts +++ b/src/gateway/events/Message.ts @@ -42,22 +42,25 @@ export async function Message(this: WebSocket, buffer: WS.Data) { return; } - const transaction = Sentry.startTransaction({ + const transaction = data.op != 1 ? Sentry.startTransaction({ op: OPCODES[data.op], name: `GATEWAY ${OPCODES[data.op]}`, data: { ...data.d, token: data?.d?.token ? "[Redacted]" : undefined, }, - }); + }) : undefined; try { var ret = await OPCodeHandler.call(this, data); - transaction.finish(); + transaction?.finish(); return ret; } catch (error) { - Sentry.captureException(error); - transaction.finish(); + Sentry.withScope((scope) => { + scope.setSpan(transaction); + Sentry.captureException(error); + }); + transaction?.finish(); console.error(`Error: Op ${data.op}`, error); // if (!this.CLOSED && this.CLOSING) return this.close(CLOSECODES.Unknown_error); |