tasko/instrumentation.ts

22 lines
547 B
TypeScript
Raw Normal View History

2024-11-27 05:47:14 +00:00
import * as Sentry from '@sentry/nextjs';
export async function register() {
if (process.env.NEXT_RUNTIME === 'nodejs') {
await import('./sentry.server.config');
const { registerInitialCache } = await import(
'@neshca/cache-handler/instrumentation'
);
const CacheHandler = (await import('./cache-handler')).default;
await registerInitialCache(CacheHandler);
2024-11-27 05:47:14 +00:00
}
if (process.env.NEXT_RUNTIME === 'edge') {
await import('./sentry.edge.config');
}
}
export const onRequestError = Sentry.captureRequestError;