Skip to content

Commit d1f8ea3

Browse files
authored
feat(server): support config ThrowableError (#311)
This allow config throwable-error this can helpful when you want more strict error types - js allow throw any value but by default oRPC treat you throw an Error instance, it's a best practice and fine in 99.5% cases <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Documentation** - Introduced a new “No Throw Literal” page with best practice guidelines. - Updated the sidebar navigation to include a link to the new content. - **New Features** - Enhanced responses with a clear success indicator, improving clarity on operation outcomes. - **Refactor** - Streamlined error handling across the system, enabling more flexible error type usage. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent aac73c2 commit d1f8ea3

File tree

33 files changed

+177
-119
lines changed

33 files changed

+177
-119
lines changed

apps/content/.vitepress/config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ export default defineConfig({
141141
collapsed: true,
142142
items: [
143143
{ text: 'Dedupe Middleware', link: '/docs/best-practices/dedupe-middleware' },
144+
{ text: 'No Throw Literal', link: '/docs/best-practices/no-throw-literal' },
144145
],
145146
},
146147
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: No Throw Literal
3+
description: Always throw `Error` instances instead of literal values.
4+
---
5+
6+
# No Throw Literal
7+
8+
In JavaScript, you can throw any value, but it's best to throw only `Error` instances.
9+
10+
```ts
11+
// eslint-disable-next-line no-throw-literal
12+
throw 'error' // ✗ avoid
13+
throw new Error('error') // ✓ recommended
14+
```
15+
16+
:::info
17+
oRPC treats thrown `Error` instances as best practice by default, as recommended by the [JavaScript Standard Style](https://standardjs.com/rules.html#throw-new-error-old-style).
18+
:::
19+
20+
## Configuration
21+
22+
Customize oRPC's behavior by setting `throwableError` in the `Registry`:
23+
24+
```ts
25+
declare module '@orpc/server' { // or '@orpc/contract', or '@orpc/client'
26+
interface Registry {
27+
throwableError: Error // [!code highlight]
28+
}
29+
}
30+
```
31+
32+
:::info
33+
Avoid using `any` or `unknown` for `throwableError` because doing so prevents the client from inferring [type-safe errors](/docs/client/error-handling#using-safe-and-isdefinederror). Instead, use `null | undefined | {}` (equivalent to `unknown`) for stricter error type inference.
34+
:::
35+
36+
:::tip
37+
If you configure `throwableError` as `null | undefined | {}`, adjust your code to check the `success` property:
38+
39+
```ts
40+
const { error, data, success } = await safe(client('input'))
41+
42+
if (!success) {
43+
if (isDefinedError(error)) {
44+
// handle type-safe error
45+
}
46+
// handle other errors
47+
}
48+
else {
49+
// handle success
50+
}
51+
```
52+
53+
:::
54+
55+
## Bonus
56+
57+
If you use ESLint, enable the [no-throw-literal](https://eslint.org/docs/rules/no-throw-literal) rule to enforce throwing only `Error` instances.

packages/client/src/adapters/standard/link.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Interceptor } from '@orpc/shared'
1+
import type { Interceptor, ThrowableError } from '@orpc/shared'
22
import type { StandardLazyResponse, StandardRequest } from '@orpc/standard-server'
33
import type { ClientContext, ClientLink, ClientOptions } from '../../types'
44
import type { StandardLinkClient, StandardLinkCodec } from './types'
@@ -11,8 +11,8 @@ export interface StandardLinkPlugin<T extends ClientContext> {
1111
}
1212

1313
export interface StandardLinkOptions<T extends ClientContext> {
14-
interceptors?: Interceptor<{ path: readonly string[], input: unknown, options: ClientOptions<T> }, unknown, unknown>[]
15-
clientInterceptors?: Interceptor<{ request: StandardRequest }, StandardLazyResponse, unknown>[]
14+
interceptors?: Interceptor<{ path: readonly string[], input: unknown, options: ClientOptions<T> }, unknown, ThrowableError>[]
15+
clientInterceptors?: Interceptor<{ request: StandardRequest }, StandardLazyResponse, ThrowableError>[]
1616
plugins?: StandardLinkPlugin<T>[]
1717
}
1818

packages/client/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ export * from './types'
66
export * from './utils'
77

88
export { onError, onFinish, onStart, onSuccess } from '@orpc/shared'
9+
export type { Registry, ThrowableError } from '@orpc/shared'
910
export { ErrorEvent } from '@orpc/standard-server'

packages/client/src/types.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ export type ClientRest<TClientContext extends ClientContext, TInput> = Record<ne
1515
: [input: TInput, options?: FriendlyClientOptions<TClientContext>]
1616
: [input: TInput, options: FriendlyClientOptions<TClientContext>]
1717

18-
export type ClientPromiseResult<TOutput, TError extends Error> = PromiseWithError<TOutput, TError>
18+
export type ClientPromiseResult<TOutput, TError> = PromiseWithError<TOutput, TError>
1919

20-
export interface Client<TClientContext extends ClientContext, TInput, TOutput, TError extends Error> {
20+
export interface Client<TClientContext extends ClientContext, TInput, TOutput, TError> {
2121
(...rest: ClientRest<TClientContext, TInput>): ClientPromiseResult<TOutput, TError>
2222
}
2323

packages/client/src/utils.test-d.ts

+11-4
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ describe('safe', async () => {
77
const client = {} as Client<ClientContext, string, number, Error | ORPCError<'BAD_GATEWAY', { val: string }>>
88

99
it('tuple style', async () => {
10-
const [error, data, isDefined] = await safe(client('123'))
10+
const [error, data, isDefined, success] = await safe(client('123'))
1111

12-
if (error) {
12+
if (error || !success) {
1313
expectTypeOf(error).toEqualTypeOf<Error | ORPCError<'BAD_GATEWAY', { val: string }>>()
1414
expectTypeOf(data).toEqualTypeOf<undefined>()
1515
expectTypeOf(isDefined).toEqualTypeOf<boolean>()
@@ -33,9 +33,9 @@ describe('safe', async () => {
3333
})
3434

3535
it('object style', async () => {
36-
const { error, data, isDefined } = await safe(client('123'))
36+
const { error, data, isDefined, success } = await safe(client('123'))
3737

38-
if (error) {
38+
if (error || !success) {
3939
expectTypeOf(error).toEqualTypeOf<Error | ORPCError<'BAD_GATEWAY', { val: string }>>()
4040
expectTypeOf(data).toEqualTypeOf<undefined>()
4141
expectTypeOf(isDefined).toEqualTypeOf<boolean>()
@@ -57,4 +57,11 @@ describe('safe', async () => {
5757
expectTypeOf(isDefined).toEqualTypeOf<false>()
5858
}
5959
})
60+
61+
it('can catch Promise', async () => {
62+
const { error, data } = await safe({} as Promise<number>)
63+
64+
expectTypeOf(error).toEqualTypeOf<Error | null>()
65+
expectTypeOf(data).toEqualTypeOf<number | undefined >()
66+
})
6067
})

packages/client/src/utils.test.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@ import { resolveFriendlyClientOptions, safe } from './utils'
33

44
it('safe', async () => {
55
const r1 = await safe(Promise.resolve(1))
6-
expect([...r1]).toEqual([null, 1, false])
7-
expect({ ...r1 }).toEqual(expect.objectContaining({ error: null, data: 1, isDefined: false }))
6+
expect([...r1]).toEqual([null, 1, false, true])
7+
expect({ ...r1 }).toEqual(expect.objectContaining({ error: null, data: 1, isDefined: false, success: true }))
88

99
const e2 = new Error('error')
1010
const r2 = await safe(Promise.reject(e2))
11-
expect([...r2]).toEqual([e2, undefined, false])
12-
expect({ ...r2 }).toEqual(expect.objectContaining({ error: e2, data: undefined, isDefined: false }))
11+
expect([...r2]).toEqual([e2, undefined, false, false])
12+
expect({ ...r2 }).toEqual(expect.objectContaining({ error: e2, data: undefined, isDefined: false, success: false }))
1313

1414
const e3 = new ORPCError('BAD_GATEWAY', { defined: true })
1515
const r3 = await safe(Promise.reject(e3))
16-
expect([...r3]).toEqual([e3, undefined, true])
17-
expect({ ...r3 }).toEqual(expect.objectContaining({ error: e3, data: undefined, isDefined: true }))
16+
expect([...r3]).toEqual([e3, undefined, true, false])
17+
expect({ ...r3 }).toEqual(expect.objectContaining({ error: e3, data: undefined, isDefined: true, success: false }))
1818

1919
const e4 = new ORPCError('BAD_GATEWAY')
2020
const r4 = await safe(Promise.reject(e4))
21-
expect([...r4]).toEqual([e4, undefined, false])
22-
expect({ ...r4 }).toEqual(expect.objectContaining({ error: e4, data: undefined, isDefined: false }))
21+
expect([...r4]).toEqual([e4, undefined, false, false])
22+
expect({ ...r4 }).toEqual(expect.objectContaining({ error: e4, data: undefined, isDefined: false, success: false }))
2323
})
2424

2525
it('resolveFriendlyClientOptions', () => {

packages/client/src/utils.ts

+15-14
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
1+
import type { ThrowableError } from '@orpc/shared'
12
import type { ORPCError } from './error'
23
import type { ClientContext, ClientOptions, ClientPromiseResult, FriendlyClientOptions } from './types'
34
import { isDefinedError } from './error'
45

5-
export type SafeResult<TOutput, TError extends Error> =
6-
| [error: null, data: TOutput, isDefined: false]
7-
& { error: null, data: TOutput, isDefined: false }
8-
| [error: Exclude<TError, ORPCError<any, any>>, data: undefined, isDefined: false]
9-
& { error: Exclude<TError, ORPCError<any, any>>, data: undefined, isDefined: false }
10-
| [error: Extract<TError, ORPCError<any, any>>, data: undefined, isDefined: true]
11-
& { error: Extract<TError, ORPCError<any, any>>, data: undefined, isDefined: true }
6+
export type SafeResult<TOutput, TError> =
7+
| [error: null, data: TOutput, isDefined: false, success: true]
8+
& { error: null, data: TOutput, isDefined: false, success: true }
9+
| [error: Exclude<TError, ORPCError<any, any>>, data: undefined, isDefined: false, success: false]
10+
& { error: Exclude<TError, ORPCError<any, any>>, data: undefined, isDefined: false, success: false }
11+
| [error: Extract<TError, ORPCError<any, any>>, data: undefined, isDefined: true, success: false]
12+
& { error: Extract<TError, ORPCError<any, any>>, data: undefined, isDefined: true, success: false }
1213

13-
export async function safe<TOutput, TError extends Error>(promise: ClientPromiseResult<TOutput, TError>): Promise<SafeResult<TOutput, TError>> {
14+
export async function safe<TOutput, TError = ThrowableError>(promise: ClientPromiseResult<TOutput, TError>): Promise<SafeResult<TOutput, TError>> {
1415
try {
1516
const output = await promise
1617
return Object.assign(
17-
[null, output, false] satisfies [null, TOutput, false],
18-
{ error: null, data: output, isDefined: false as const },
18+
[null, output, false, true] satisfies [null, TOutput, false, true],
19+
{ error: null, data: output, isDefined: false as const, success: true as const },
1920
)
2021
}
2122
catch (e) {
2223
const error = e as TError
2324

2425
if (isDefinedError(error)) {
2526
return Object.assign(
26-
[error, undefined, true] satisfies [typeof error, undefined, true],
27-
{ error, data: undefined, isDefined: true as const },
27+
[error, undefined, true, false] satisfies [typeof error, undefined, true, false],
28+
{ error, data: undefined, isDefined: true as const, success: false as const },
2829
)
2930
}
3031

3132
return Object.assign(
32-
[error as Exclude<TError, ORPCError<any, any>>, undefined, false] satisfies [Exclude<TError, ORPCError<any, any>>, undefined, false],
33-
{ error: error as Exclude<TError, ORPCError<any, any>>, data: undefined, isDefined: false as const },
33+
[error as Exclude<TError, ORPCError<any, any>>, undefined, false, false] satisfies [Exclude<TError, ORPCError<any, any>>, undefined, false, false],
34+
{ error: error as Exclude<TError, ORPCError<any, any>>, data: undefined, isDefined: false as const, success: false as const },
3435
)
3536
}
3637
}

packages/contract/src/error.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { ORPCError, ORPCErrorCode } from '@orpc/client'
2+
import type { ThrowableError } from '@orpc/shared'
23
import type { AnySchema, InferSchemaOutput, Schema, SchemaIssue } from './schema'
34

45
export interface ValidationErrorOptions extends ErrorOptions {
@@ -40,4 +41,4 @@ export type ORPCErrorFromErrorMap<TErrorMap extends ErrorMap> = {
4041
: never
4142
}[keyof TErrorMap]
4243

43-
export type ErrorFromErrorMap<TErrorMap extends ErrorMap> = Error | ORPCErrorFromErrorMap<TErrorMap>
44+
export type ErrorFromErrorMap<TErrorMap extends ErrorMap> = ORPCErrorFromErrorMap<TErrorMap> | ThrowableError

packages/contract/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ export * from './router-utils'
1515
export * from './schema'
1616

1717
export { ORPCError } from '@orpc/client'
18+
export type { Registry, ThrowableError } from '@orpc/shared'

packages/react-query/src/procedure-utils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { InfiniteData } from '@tanstack/react-query'
44
import type { InfiniteOptionsBase, InfiniteOptionsIn, MutationOptions, MutationOptionsIn, QueryOptionsBase, QueryOptionsIn } from './types'
55
import { buildKey } from './key'
66

7-
export interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError extends Error> {
7+
export interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError> {
88
call: Client<TClientContext, TInput, TOutput, TError>
99

1010
queryOptions<U, USelectData = TOutput>(
@@ -26,7 +26,7 @@ export interface CreateProcedureUtilsOptions {
2626
path: string[]
2727
}
2828

29-
export function createProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError extends Error>(
29+
export function createProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError>(
3030
client: Client<TClientContext, TInput, TOutput, TError>,
3131
options: CreateProcedureUtilsOptions,
3232
): ProcedureUtils<TClientContext, TInput, TOutput, TError> {

packages/react-query/src/types.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,30 @@ import type { ClientContext } from '@orpc/client'
22
import type { SetOptional } from '@orpc/shared'
33
import type { QueryFunctionContext, QueryKey, UseInfiniteQueryOptions, UseMutationOptions, UseQueryOptions } from '@tanstack/react-query'
44

5-
export type QueryOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError extends Error, TSelectData> =
5+
export type QueryOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData> =
66
& (undefined extends TInput ? { input?: TInput } : { input: TInput })
77
& (Record<never, never> extends TClientContext ? { context?: TClientContext } : { context: TClientContext })
88
& SetOptional<UseQueryOptions<TOutput, TError, TSelectData>, 'queryKey'>
99

10-
export interface QueryOptionsBase<TOutput, TError extends Error> {
10+
export interface QueryOptionsBase<TOutput, TError> {
1111
queryKey: QueryKey
1212
queryFn(ctx: QueryFunctionContext): Promise<TOutput>
1313
retry?(failureCount: number, error: TError): boolean // this make tanstack can infer the TError type
1414
}
1515

16-
export type InfiniteOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError extends Error, TSelectData, TPageParam> =
16+
export type InfiniteOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData, TPageParam> =
1717
& { input: (pageParam: TPageParam) => TInput }
1818
& (Record<never, never> extends TClientContext ? { context?: TClientContext } : { context: TClientContext })
1919
& SetOptional<UseInfiniteQueryOptions<TOutput, TError, TSelectData, TOutput, QueryKey, TPageParam>, 'queryKey'>
2020

21-
export interface InfiniteOptionsBase<TOutput, TError extends Error, TPageParam> {
21+
export interface InfiniteOptionsBase<TOutput, TError, TPageParam> {
2222
queryKey: QueryKey
2323
queryFn(ctx: QueryFunctionContext<QueryKey, TPageParam>): Promise<TOutput>
2424
retry?(failureCount: number, error: TError): boolean // this make tanstack can infer the TError type
2525
}
2626

27-
export type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError extends Error, TMutationContext> =
27+
export type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TMutationContext> =
2828
& (Record<never, never> extends TClientContext ? { context?: TClientContext } : { context: TClientContext })
2929
& MutationOptions<TInput, TOutput, TError, TMutationContext>
3030

31-
export type MutationOptions<TInput, TOutput, TError extends Error, TMutationContext> = UseMutationOptions<TOutput, TError, TInput, TMutationContext>
31+
export type MutationOptions<TInput, TOutput, TError, TMutationContext> = UseMutationOptions<TOutput, TError, TInput, TMutationContext>

packages/react/src/hooks/action-hooks.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@ import { ORPCError, safe } from '@orpc/client'
44
import { intercept, type Interceptor, toArray } from '@orpc/shared'
55
import { useCallback, useMemo, useState } from 'react'
66

7-
export interface UseServerActionOptions<TInput, TOutput, TError extends Error> {
7+
export interface UseServerActionOptions<TInput, TOutput, TError> {
88
interceptors?: Interceptor<{ input: TInput }, TOutput, TError>[]
99
}
1010

11-
export interface UseServerActionExecuteOptions<TInput, TOutput, TError extends Error> extends Pick<UseServerActionOptions<TInput, TOutput, TError>, 'interceptors'> {
11+
export interface UseServerActionExecuteOptions<TInput, TOutput, TError> extends Pick<UseServerActionOptions<TInput, TOutput, TError>, 'interceptors'> {
1212
}
1313

14-
export type UseServerActionExecuteRest<TInput, TOutput, TError extends Error> =
14+
export type UseServerActionExecuteRest<TInput, TOutput, TError> =
1515
undefined extends TInput
1616
? [input?: TInput, options?: UseServerActionExecuteOptions<TInput, TOutput, TError>]
1717
: [input: TInput, options?: UseServerActionExecuteOptions<TInput, TOutput, TError>]
1818

19-
export interface UseServerActionResultBase<TInput, TOutput, TError extends Error> {
19+
export interface UseServerActionResultBase<TInput, TOutput, TError> {
2020
reset: () => void
2121
execute: (...rest: UseServerActionExecuteRest<TInput, TOutput, TError>) => Promise<SafeResult<TOutput, TError>>
2222
}
2323

24-
export interface UseServerActionIdleResult<TInput, TOutput, TError extends Error> extends UseServerActionResultBase<TInput, TOutput, TError> {
24+
export interface UseServerActionIdleResult<TInput, TOutput, TError> extends UseServerActionResultBase<TInput, TOutput, TError> {
2525
input: undefined
2626
data: undefined
2727
error: null
@@ -33,7 +33,7 @@ export interface UseServerActionIdleResult<TInput, TOutput, TError extends Error
3333
executedAt: undefined
3434
}
3535

36-
export interface UseServerActionPendingResult<TInput, TOutput, TError extends Error> extends UseServerActionResultBase<TInput, TOutput, TError> {
36+
export interface UseServerActionPendingResult<TInput, TOutput, TError> extends UseServerActionResultBase<TInput, TOutput, TError> {
3737
input: TInput
3838
data: undefined
3939
error: null
@@ -45,7 +45,7 @@ export interface UseServerActionPendingResult<TInput, TOutput, TError extends Er
4545
executedAt: Date
4646
}
4747

48-
export interface UseServerActionSuccessResult<TInput, TOutput, TError extends Error> extends UseServerActionResultBase<TInput, TOutput, TError> {
48+
export interface UseServerActionSuccessResult<TInput, TOutput, TError> extends UseServerActionResultBase<TInput, TOutput, TError> {
4949
input: TInput
5050
data: TOutput
5151
error: null
@@ -57,7 +57,7 @@ export interface UseServerActionSuccessResult<TInput, TOutput, TError extends Er
5757
executedAt: Date
5858
}
5959

60-
export interface UseServerActionErrorResult<TInput, TOutput, TError extends Error> extends UseServerActionResultBase<TInput, TOutput, TError> {
60+
export interface UseServerActionErrorResult<TInput, TOutput, TError> extends UseServerActionResultBase<TInput, TOutput, TError> {
6161
input: TInput
6262
data: undefined
6363
error: TError

packages/server/src/adapters/fetch/handler.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import type { Interceptor, MaybeOptionalOptions, ThrowableError } from '@orpc/shared'
12
import type { Context } from '../../context'
23
import type { StandardHandleOptions, StandardHandler, StandardHandlerPlugin } from '../standard'
34
import type { FriendlyStandardHandleOptions } from '../standard/utils'
4-
import { intercept, type Interceptor, type MaybeOptionalOptions, resolveMaybeOptionalOptions, toArray } from '@orpc/shared'
5+
import { intercept, resolveMaybeOptionalOptions, toArray } from '@orpc/shared'
56
import { toFetchResponse, type ToFetchResponseOptions, toStandardLazyRequest } from '@orpc/standard-server-fetch'
67
import { resolveFriendlyStandardHandleOptions } from '../standard/utils'
78

@@ -17,7 +18,7 @@ export interface FetchHandlerInterceptorOptions<T extends Context> extends Stand
1718
}
1819

1920
export interface FetchHandlerOptions<T extends Context> extends ToFetchResponseOptions {
20-
adapterInterceptors?: Interceptor<FetchHandlerInterceptorOptions<T>, FetchHandleResult, unknown >[]
21+
adapterInterceptors?: Interceptor<FetchHandlerInterceptorOptions<T>, FetchHandleResult, ThrowableError>[]
2122

2223
plugins?: FetchHandlerPlugin<T>[]
2324
}

packages/server/src/adapters/node/handler.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import type { Interceptor, MaybeOptionalOptions, ThrowableError } from '@orpc/shared'
12
import type { NodeHttpRequest, NodeHttpResponse, SendStandardResponseOptions } from '@orpc/standard-server-node'
23
import type { Context } from '../../context'
34
import type { StandardHandleOptions, StandardHandler, StandardHandlerPlugin } from '../standard'
4-
import { intercept, type Interceptor, type MaybeOptionalOptions, resolveMaybeOptionalOptions, toArray } from '@orpc/shared'
5+
import { intercept, resolveMaybeOptionalOptions, toArray } from '@orpc/shared'
56
import { sendStandardResponse, toStandardLazyRequest } from '@orpc/standard-server-node'
67
import { type FriendlyStandardHandleOptions, resolveFriendlyStandardHandleOptions } from '../standard/utils'
78

@@ -18,7 +19,7 @@ export interface NodeHttpHandlerInterceptorOptions<T extends Context> extends St
1819
}
1920

2021
export interface NodeHttpHandlerOptions<T extends Context> extends SendStandardResponseOptions {
21-
adapterInterceptors?: Interceptor<NodeHttpHandlerInterceptorOptions<T>, NodeHttpHandleResult, unknown >[]
22+
adapterInterceptors?: Interceptor<NodeHttpHandlerInterceptorOptions<T>, NodeHttpHandleResult, ThrowableError>[]
2223

2324
plugins?: NodeHttpHandlerPlugin<T>[]
2425
}

0 commit comments

Comments
 (0)