mirror of
https://github.com/s-frick/effigenix.git
synced 2026-03-28 17:19:56 +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:
parent
5fe0dfc139
commit
df1d1dfdd3
9 changed files with 818 additions and 6 deletions
|
|
@ -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();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue