Skip to content

Commit 4fbf19b

Browse files
committed
change to console.error
1 parent 5ec08d8 commit 4fbf19b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/next/src/server/web/globals.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,9 @@ export async function edgeInstrumentationOnRequestError(
4343
) {
4444
await instrumentation.onRequestError(...args)
4545
}
46-
} catch (err: any) {
47-
// Throw hard error since middleware is critical path here, if it's error then the request will fail anyway.
48-
err.message = `An error occurred while running instrumentation request error handler: ${err.message}`
49-
throw err
46+
} catch (err) {
47+
// Log the soft error and continue, since the original error has already been thrown
48+
console.error('Error in instrumentation.onRequestError:', err)
5049
}
5150
}
5251

0 commit comments

Comments
 (0)