feat: with sentry node in dependensies and sentry dsn in index
Some checks failed
CI/CD / test (push) Failing after 9s
CI/CD / deploy (push) Failing after 34s

This commit is contained in:
Stepan Vladovskiy 2024-04-07 15:14:38 -03:00
parent bebfd46958
commit 4808d6d613
2 changed files with 13 additions and 1 deletions

View File

@ -7,6 +7,9 @@ const authorizer = new Authorizer({
redirectURL: 'https://testing.discours.io', redirectURL: 'https://testing.discours.io',
}); });
const Sentry = require("@sentry/node");
Sentry.init({ dsn: 'https://c98cd247c6744938a4daf0b3118722a2@glitchtip.discours.io/4' });
const startServer = async () => { const startServer = async () => {
const server = await Server.configure({ const server = await Server.configure({
port: process.env.PORT || 4000, port: process.env.PORT || 4000,
@ -39,4 +42,12 @@ const startServer = async () => {
server.listen(); server.listen();
}; };
process.on('unhandledRejection', (reason, promise) => {
Sentry.captureException(reason);
});
process.on('uncaughtException', (error) => {
Sentry.captureException(error);
});
startServer(); startServer();

View File

@ -15,6 +15,7 @@
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@authorizerdev/authorizer-js": "^2.0.0", "@authorizerdev/authorizer-js": "^2.0.0",
"@hocuspocus/server": "^2.11.2" "@hocuspocus/server": "^2.11.2",
"@sentry/node": "^6.14.0"
} }
} }