File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,11 @@ function addServerIntegrations(options: NextjsOptions): void {
118118 } ) ;
119119 integrations = addOrUpdateIntegration ( defaultRewriteFramesIntegration , integrations ) ;
120120
121+ const nativeBehaviourOnUncaughtException = new Integrations . OnUncaughtException ( ) ;
122+ integrations = addOrUpdateIntegration ( nativeBehaviourOnUncaughtException , integrations , {
123+ _options : { exitEvenIfOtherHandlersAreRegistered : false } ,
124+ } ) ;
125+
121126 if ( hasTracingEnabled ( options ) ) {
122127 const defaultHttpTracingIntegration = new Integrations . Http ( { tracing : true } ) ;
123128 integrations = addOrUpdateIntegration ( defaultHttpTracingIntegration , integrations , {
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { logAndExitProcess } from './utils/errorhandling';
77
88type OnFatalErrorHandler = ( firstError : Error , secondError ?: Error ) => void ;
99
10+ // CAREFUL: Please think twice before updating the way _options looks because the Next.js SDK depends on it in `index.server.ts`
1011interface OnUncaughtExceptionOptions {
1112 // TODO(v8): Evaluate whether we should switch the default behaviour here.
1213 // Also, we can evaluate using https://nodejs.org/api/process.html#event-uncaughtexceptionmonitor per default, and
@@ -48,6 +49,7 @@ export class OnUncaughtException implements Integration {
4849 */
4950 public readonly handler : ( error : Error ) => void = this . _makeErrorHandler ( ) ;
5051
52+ // CAREFUL: Please think twice before updating the way _options looks because the Next.js SDK depends on it in `index.server.ts`
5153 private readonly _options : OnUncaughtExceptionOptions ;
5254
5355 /**
You can’t perform that action at this time.
0 commit comments