Skip to content

Commit 07ecf5a

Browse files
committed
cleanup
1 parent 4e6a6e0 commit 07ecf5a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/errors/errorHandler.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ import {
66
isPublicNonRecoverableError,
77
isStandardizedError,
88
} from '@lokalise/node-core'
9-
import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify'
9+
import type { FastifyReply, FastifyRequest } from 'fastify'
1010
import {
1111
hasZodFastifySchemaValidationErrors,
1212
isResponseSerializationError,
1313
} from 'fastify-type-provider-zod'
1414
import pino from 'pino'
1515
import type { ZodError } from 'zod'
16+
import type { AnyFastifyInstance } from '../plugins/pluginsCommon'
1617

1718
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
1819
export type FreeformRecord = Record<string, any>
@@ -128,16 +129,16 @@ export type ErrorHandlerParams = {
128129
resolveLogObject?: (error: unknown) => FreeformRecord | undefined
129130
}
130131

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,
134136
error: FreeformRecord,
135137
request: FastifyRequest,
136138
reply: FastifyReply,
137139
) => void {
138140
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,
141142
error: FreeformRecord,
142143
request: FastifyRequest,
143144
reply: FastifyReply,

0 commit comments

Comments
 (0)