@@ -6,13 +6,14 @@ import {
6
6
isPublicNonRecoverableError ,
7
7
isStandardizedError ,
8
8
} from '@lokalise/node-core'
9
- import type { FastifyInstance , FastifyReply , FastifyRequest } from 'fastify'
9
+ import type { FastifyReply , FastifyRequest } from 'fastify'
10
10
import {
11
11
hasZodFastifySchemaValidationErrors ,
12
12
isResponseSerializationError ,
13
13
} from 'fastify-type-provider-zod'
14
14
import pino from 'pino'
15
15
import type { ZodError } from 'zod'
16
+ import type { AnyFastifyInstance } from '../plugins/pluginsCommon'
16
17
17
18
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
18
19
export type FreeformRecord = Record < string , any >
@@ -128,16 +129,16 @@ export type ErrorHandlerParams = {
128
129
resolveLogObject ?: ( error : unknown ) => FreeformRecord | undefined
129
130
}
130
131
131
- export function createErrorHandler ( params : ErrorHandlerParams ) : (
132
- // biome-ignore lint/suspicious/noExplicitAny: We should support any fastify instance generics
133
- this : FastifyInstance < any , any , any , any , any > ,
132
+ export function createErrorHandler (
133
+ params : ErrorHandlerParams ,
134
+ ) : (
135
+ this : AnyFastifyInstance ,
134
136
error : FreeformRecord ,
135
137
request : FastifyRequest ,
136
138
reply : FastifyReply ,
137
139
) => void {
138
140
return function errorHandler (
139
- // biome-ignore lint/suspicious/noExplicitAny: We should support any fastify instance generics
140
- this : FastifyInstance < any , any , any , any , any > ,
141
+ this : AnyFastifyInstance ,
141
142
error : FreeformRecord ,
142
143
request : FastifyRequest ,
143
144
reply : FastifyReply ,
0 commit comments