Skip to content

Commit

Permalink
change to console.error
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Jul 10, 2024
1 parent 5ec08d8 commit 4fbf19b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/next/src/server/web/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@ export async function edgeInstrumentationOnRequestError(
) {
await instrumentation.onRequestError(...args)
}
} catch (err: any) {
// Throw hard error since middleware is critical path here, if it's error then the request will fail anyway.
err.message = `An error occurred while running instrumentation request error handler: ${err.message}`
throw err
} catch (err) {
// Log the soft error and continue, since the original error has already been thrown
console.error('Error in instrumentation.onRequestError:', err)
}
}

Expand Down

0 comments on commit 4fbf19b

Please sign in to comment.