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

Function withSetScope

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

Source from the content-addressed store, hash-verified

48 }
49
50 function withSetScope<T>(scope: Scope, callback: (scope: Scope) => T): T {
51 const isolationScope = getScopes().isolationScope.clone();
52 return asyncStorage.run({ scope, isolationScope }, () => {
53 return callback(scope);
54 });
55 }
56
57 function withIsolationScope<T>(callback: (isolationScope: Scope) => T): T {
58 const scope = getScopes().scope;

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected