diff --git a/.bruno/cards/multiple.bru b/.bruno/cards/multiple.bru index 7aeca13fb..5026514e4 100644 --- a/.bruno/cards/multiple.bru +++ b/.bruno/cards/multiple.bru @@ -19,5 +19,5 @@ params:query { assert { res.status: eq 200 - res.body: length 85 + res.body.length: gt 85 } diff --git a/.bruno/fixes/567-invalid-data-returned-when-filtering-using-set.bru b/.bruno/fixes/567-invalid-data-returned-when-filtering-using-set.bru index 7fd289e0c..163f952c2 100644 --- a/.bruno/fixes/567-invalid-data-returned-when-filtering-using-set.bru +++ b/.bruno/fixes/567-invalid-data-returned-when-filtering-using-set.bru @@ -17,5 +17,5 @@ params:query { assert { res.status: eq 200 - res.body.length: lt 0 + res.body.length: gte 6 } diff --git a/server/.gitignore b/server/.gitignore index b5128cd15..eff34f14c 100644 --- a/server/.gitignore +++ b/server/.gitignore @@ -4,3 +4,5 @@ /public/**/graphql.gql /public/**/api.d.ts /public/**/openapi.yaml +.env +.env.* diff --git a/server/bun.lockb b/server/bun.lockb index 4f5570558..031974f98 100755 Binary files a/server/bun.lockb and b/server/bun.lockb differ diff --git a/server/package.json b/server/package.json index b798e5d38..e9d1186b0 100644 --- a/server/package.json +++ b/server/package.json @@ -13,6 +13,7 @@ "@dzeio/config": "^1", "@dzeio/object-util": "^1", "@dzeio/queue": "^1", + "@sentry/node": "^8", "@tcgdex/sdk": "^2", "apicache": "^1", "express": "^4", diff --git a/server/src/index.ts b/server/src/index.ts index 37324fecb..be014a9eb 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -5,6 +5,13 @@ import { Errors, sendError } from './libs/Errors' import status from './status' import jsonEndpoints from './V2/endpoints/jsonEndpoints' import graphql from './V2/graphql' +import * as Sentry from "@sentry/node" + +// Glitchtip will only start if the DSN is set :D +Sentry.init({ + dsn: process.env.GLITCHTIP_DSN, + environment: process.env.NODE_ENV +}) if (cluster.isPrimary) { console.log(`Primary ${process.pid} is running`) @@ -107,7 +114,8 @@ if (cluster.isPrimary) { sendError(Errors.NOT_FOUND, res) }) - // General error handler + // Error handlers + Sentry.setupExpressErrorHandler(server) server.use((err: Error, _1: unknown, res: Response, _2: unknown) => { // add a full line dash to not miss it const columns = (process?.stdout?.columns ?? 32) - 7