Skip to content

Commit 95d162e

Browse files
committed
switch if statement
1 parent 55f1bd2 commit 95d162e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/nuxt/src/runtime/plugins/sentry-cloudflare.server.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ export const sentryCloudflareNitroPlugin =
8181
const pathname = handlerArgs[0];
8282
const event = handlerArgs[1];
8383

84-
if (isEventType(event)) {
84+
if (!isEventType(event)) {
85+
logger.log("Nitro Cloudflare plugin did not detect a Cloudflare event type. Won't patch Cloudflare handler.");
86+
return handlerTarget.apply(handlerThisArg, handlerArgs);
87+
} else {
8588
const requestHandlerOptions = {
8689
options: { ...sentryOptions, continueTraceFromPropagationContext: true },
8790
request: { ...event, url: `${event.protocol}//${event.host}${pathname}` },
@@ -110,8 +113,6 @@ export const sentryCloudflareNitroPlugin =
110113
return handlerTarget.apply(handlerThisArg, handlerArgs);
111114
});
112115
}
113-
114-
return handlerTarget.apply(handlerThisArg, handlerArgs);
115116
},
116117
});
117118

0 commit comments

Comments
 (0)