MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / withScope

Function withScope

packages/cloudflare/src/async.ts:42–48  ·  view source on GitHub ↗
(callback: (scope: Scope) => T)

Source from the content-addressed store, hash-verified

40 }
41
42 function withScope<T>(callback: (scope: Scope) => T): T {
43 const scope = getScopes().scope.clone();
44 const isolationScope = getScopes().isolationScope;
45 return asyncStorage.run({ scope, isolationScope }, () => {
46 return callback(scope);
47 });
48 }
49
50 function withSetScope<T>(scope: Scope, callback: (scope: Scope) => T): T {
51 const isolationScope = getScopes().isolationScope.clone();

Callers 1

suppressTracingFunction · 0.70

Calls 4

getScopesFunction · 0.70
cloneMethod · 0.65
runMethod · 0.65
callbackFunction · 0.50

Tested by

no test coverage detected