1
0
Fork 0
mirror of https://github.com/s-frick/effigenix.git synced 2026-03-28 13:49:36 +01:00
effigenix/frontend/apps/cli/src/index.tsx
Sebastian Frick df1d1dfdd3 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.
2026-02-23 22:40:19 +01:00

46 lines
978 B
TypeScript

import './instrument.js';
import * as Sentry from '@sentry/node';
import React from 'react';
import { render } from 'ink';
import { App } from './App.js';
// Alternate screen buffer + clear + hide cursor
process.stdout.write('\x1b[?1049h\x1b[2J\x1b[H\x1b[?25l');
const cleanup = () => {
process.stdout.write('\x1b[?25h\x1b[?1049l');
};
process.on('exit', cleanup);
process.on('SIGINT', () => {
cleanup();
process.exit(0);
});
process.on('SIGTERM', () => {
cleanup();
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(async () => {
await Sentry.close(2000);
cleanup();
})
.catch(async (err) => {
Sentry.captureException(err);
await Sentry.close(2000);
cleanup();
});