Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@sentry:registry=http://127.0.0.1:4873
@sentry-internal:registry=http://127.0.0.1:4873
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"cf-typegen": "wrangler types --env-interface CloudflareBindings",
"test:build": "pnpm install && pnpm build",
"//": "Just checking if it builds correctly and types don't break",
"test:assert": "pnpm typecheck"
"test:assert": "pnpm typecheck && vitest run ."
},
"dependencies": {
"@sentry/cloudflare": "latest || *",
Expand Down
14 changes: 10 additions & 4 deletions packages/cloudflare/src/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,16 @@ import { copyExecutionContext } from './utils/copyExecutionContext';
* @returns The wrapped handler.
*/
// eslint-disable-next-line complexity
export function withSentry<Env = unknown, QueueHandlerMessage = unknown, CfHostMetadata = unknown>(
optionsCallback: (env: Env) => CloudflareOptions,
handler: ExportedHandler<Env, QueueHandlerMessage, CfHostMetadata>,
): ExportedHandler<Env, QueueHandlerMessage, CfHostMetadata> {
export function withSentry<
Env = unknown,
QueueHandlerMessage = unknown,
CfHostMetadata = unknown,
T extends ExportedHandler<Env, QueueHandlerMessage, CfHostMetadata> = ExportedHandler<
Env,
QueueHandlerMessage,
CfHostMetadata
>,
>(optionsCallback: (env: Env) => CloudflareOptions, handler: T): T {
setAsyncLocalStorageAsyncContextStrategy();

try {
Expand Down