Skip to content

Commit

Permalink
fix(sentry): deactivate sentry (#1147)
Browse files Browse the repository at this point in the history
  • Loading branch information
JPSchellenberg committed Jan 11, 2021
1 parent 2d4bfec commit 6637f2d
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 27 deletions.
12 changes: 6 additions & 6 deletions client/src/boot/Sentry.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as Sentry from '@sentry/browser';

if (process.env.NODE_ENV !== 'development') {
Sentry.init({
dsn: 'https://02e4da31636d479f86a17a6ef749278c@sentry.io/1876151',
release: process.env.VERSION
});
}
// if (process.env.NODE_ENV !== 'development') {
// Sentry.init({
// dsn: 'https://02e4da31636d479f86a17a6ef749278c@sentry.io/1876151',
// release: process.env.VERSION
// });
// }

export default Sentry;
4 changes: 2 additions & 2 deletions client/src/boot/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Sentry from './Sentry';
// import Sentry from './Sentry';

import Logger from '../helpers/Logger';

Expand All @@ -19,7 +19,7 @@ import App from '../views/App';
const log = new Logger('root');

log.info(`booting v${process.env.VERSION}`);
Sentry.captureMessage('start');
// Sentry.captureMessage('start');

declare var window: any;

Expand Down
8 changes: 4 additions & 4 deletions server/src/boot/app.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as H5P from '@lumieducation/h5p-server';
import * as Sentry from '@sentry/node';
// import * as Sentry from '@sentry/node';
import bodyParser from 'body-parser';
import express from 'express';
import fileUpload from 'express-fileupload';
Expand Down Expand Up @@ -98,7 +98,7 @@ export default async (serverConfig: IServerConfig) => {
// );

const app = express();
app.use(Sentry.Handlers.requestHandler());
// app.use(Sentry.Handlers.requestHandler());

app.use(bodyParser.json({ limit: h5pEditor.config.maxTotalSize }));
app.use(
Expand Down Expand Up @@ -132,10 +132,10 @@ export default async (serverConfig: IServerConfig) => {

app.use('/', routes(h5pEditor, h5pPlayer, serverConfig));

app.use(Sentry.Handlers.errorHandler());
// app.use(Sentry.Handlers.errorHandler());

app.use((error, req, res, next) => {
Sentry.captureException(error);
// Sentry.captureException(error);
res.status(error.status || 500).json({
code: error.code,
message: error.message,
Expand Down
4 changes: 2 additions & 2 deletions server/src/boot/setup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as Sentry from '@sentry/node';
// import * as Sentry from '@sentry/node';
import fsExtra from 'fs-extra';

import IServerConfig from '../IServerConfig';
Expand Down Expand Up @@ -47,7 +47,7 @@ export default async function setup(
await h5pConfig.save();
}
} catch (error) {
Sentry.captureException(error);
// Sentry.captureException(error);
throw error;
}
}
2 changes: 1 addition & 1 deletion server/src/controllers/LumiController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default class LumiController {
);
await packageExporter.createPackage(contentId, stream, new User());

nucleus.track('export');
nucleus.track('save');
return { path };
}

Expand Down
16 changes: 8 additions & 8 deletions server/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Sentry from '@sentry/electron';
import * as SentryNode from '@sentry/node';
// import * as Sentry from '@sentry/electron';
// import * as SentryNode from '@sentry/node';
import electron from 'electron';
import log from 'electron-log';
import nucleus from 'nucleus-nodejs';
Expand All @@ -24,12 +24,12 @@ process.on('uncaughtException', (error) => {
log.error(error);
});

if (process.env.NODE_ENV !== 'development') {
Sentry.init({
dsn: 'https://02e4da31636d479f86a17a6ef749278c@sentry.io/1876151',
release: app.getVersion()
});
}
// if (process.env.NODE_ENV !== 'development') {
// Sentry.init({
// dsn: 'https://02e4da31636d479f86a17a6ef749278c@sentry.io/1876151',
// release: app.getVersion()
// });
// }

if (process.env.NODE_ENV !== 'development') {
nucleus.init('5e284c9a73aa9c0115e0d1d6');
Expand Down
8 changes: 4 additions & 4 deletions server/src/websocket.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import SocketIO from 'socket.io';
import * as Sentry from '@sentry/node';
// import * as Sentry from '@sentry/node';
import http from 'http';

import Logger from './helpers/Logger';
Expand All @@ -13,8 +13,8 @@ export default function (server: http.Server): SocketIO.Server {
log.info('new connection');
});

io.on('error', (error) => {
Sentry.captureException(error);
});
// io.on('error', (error) => {
// Sentry.captureException(error);
// });
return io;
}

0 comments on commit 6637f2d

Please sign in to comment.