1
0
Fork 0
mirror of https://github.com/s-frick/effigenix.git synced 2026-03-28 15:29:34 +01:00

feat: Sentry-kompatibles Error-Tracking (Bugsink) für Frontend und Backend

Frontend: @sentry/node mit instrument.ts, globale Error-Handler, 5xx-Interceptor.
Backend: sentry-spring-boot-starter-jakarta, Sentry.captureException im GlobalExceptionHandler.
Konfiguration über SENTRY_DSN Env-Variable, Bugsink via make bugsink startbar.
This commit is contained in:
Sebastian Frick 2026-02-23 22:40:19 +01:00
parent 5fe0dfc139
commit df1d1dfdd3
9 changed files with 818 additions and 6 deletions

View file

@ -1,3 +1,5 @@
import './instrument.js';
import * as Sentry from '@sentry/node';
import React from 'react';
import { render } from 'ink';
import { App } from './App.js';
@ -19,6 +21,26 @@ process.on('SIGTERM', () => {
process.exit(0);
});
process.on('uncaughtException', async (err) => {
Sentry.captureException(err);
await Sentry.flush(2000);
cleanup();
process.exit(1);
});
process.on('unhandledRejection', (reason) => {
Sentry.captureException(reason);
});
const { waitUntilExit } = render(<App />);
waitUntilExit().then(cleanup).catch(cleanup);
waitUntilExit()
.then(async () => {
await Sentry.close(2000);
cleanup();
})
.catch(async (err) => {
Sentry.captureException(err);
await Sentry.close(2000);
cleanup();
});

View file

@ -0,0 +1,10 @@
import * as Sentry from '@sentry/node';
Sentry.init({
dsn: process.env.SENTRY_DSN,
environment: process.env.NODE_ENV ?? 'development',
enabled: !!process.env.SENTRY_DSN,
tracesSampleRate: 0,
});
Sentry.captureException(new Error('Test from Effigenix TUI')); await
Sentry.flush(2000); console.log('Event sent');