Skip to content

Commit 7cc473d

Browse files
author
Luca Forstner
committed
Don't await
1 parent 4d16e63 commit 7cc473d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/node/src/trpc.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface SentryTrpcMiddlewareOptions {
88
interface TrpcMiddlewareArguments<T> {
99
path: string;
1010
type: 'query' | 'mutation' | 'subscription';
11-
next: () => Promise<T>;
11+
next: () => T;
1212
rawInput: unknown;
1313
}
1414

@@ -19,7 +19,7 @@ interface TrpcMiddlewareArguments<T> {
1919
* Next.js SDK)
2020
*/
2121
export async function sentryTrpcMiddleware(options: SentryTrpcMiddlewareOptions = {}) {
22-
return async function <T>({ path, type, next, rawInput }: TrpcMiddlewareArguments<T>): Promise<T> {
22+
return function <T>({ path, type, next, rawInput }: TrpcMiddlewareArguments<T>): T {
2323
const hub = getCurrentHub();
2424
const clientOptions = hub.getClient()?.getOptions();
2525
const sentryTransaction = hub.getScope()?.getTransaction();
@@ -39,6 +39,6 @@ export async function sentryTrpcMiddleware(options: SentryTrpcMiddlewareOptions
3939
sentryTransaction.setData('trpc', trpcData);
4040
}
4141

42-
return await next();
42+
return next();
4343
};
4444
}

0 commit comments

Comments
 (0)