File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed
test/e2e/on-request-error/basic Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -23,3 +23,7 @@ export type InstrumentationModule = {
2323 register ?( ) : void
2424 onRequestError ?: InstrumentationOnRequestError
2525}
26+
27+ export namespace Instrumentation {
28+ export type onRequestError = InstrumentationOnRequestError
29+ }
Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ export type {
3838 ResolvedViewport ,
3939} from './lib/metadata/types/metadata-interface'
4040
41+ export type { Instrumentation } from './server/instrumentation/types'
42+
4143/**
4244 * Stub route type for typedRoutes before `next dev` or `next build` is run
4345 * @link https://nextjs.org/docs/app/building-your-application/configuring/typescript#statically-typed-links
Original file line number Diff line number Diff line change 1- export function onRequestError ( err , request , context ) {
1+ import { type Instrumentation } from 'next'
2+
3+ export const onRequestError : Instrumentation . onRequestError = (
4+ err ,
5+ request ,
6+ context
7+ ) => {
28 fetch ( `http://localhost:${ process . env . PORT } /write-log` , {
39 method : 'POST' ,
410 body : JSON . stringify ( {
5- message : err . message ,
11+ message : ( err as Error ) . message ,
612 request,
713 context,
814 } ) ,
You can’t perform that action at this time.
0 commit comments