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

Function get

packages/cloudflare/src/workflows.ts:187–217  ·  view source on GitHub ↗
(obj, prop, receiver)

Source from the content-addressed store, hash-verified

185 const instance = Reflect.construct(target, args, newTarget) as T;
186 return new Proxy(instance, {
187 get(obj, prop, receiver) {
188 if (prop === 'run') {
189 return async function (event: WorkflowEvent<P>, step: WorkflowStep): Promise<unknown> {
190 setAsyncLocalStorageAsyncContextStrategy();
191
192 return withIsolationScope(async isolationScope => {
193 const waitUntil = context.waitUntil.bind(context);
194 const client = init({ ...options, ctx: context, enableDedupe: false });
195 isolationScope.setClient(client);
196
197 addCloudResourceContext(isolationScope);
198
199 return withScope(async scope => {
200 const propagationContext = await propagationContextFromInstanceId(event.instanceId);
201 scope.setPropagationContext(propagationContext);
202
203 try {
204 return await obj.run.call(
205 obj,
206 event,
207 new WrappedWorkflowStep(event.instanceId, options, step, waitUntil),
208 );
209 } finally {
210 waitUntil(flushAndDispose(client));
211 }
212 });
213 });
214 };
215 }
216 return Reflect.get(obj, prop, receiver);
217 },
218 });
219 },
220 });

Callers

nothing calls this directly

Calls 13

withIsolationScopeFunction · 0.90
initFunction · 0.90
addCloudResourceContextFunction · 0.90
withScopeFunction · 0.90
flushAndDisposeFunction · 0.90
waitUntilFunction · 0.85
bindMethod · 0.80
setClientMethod · 0.80
setPropagationContextMethod · 0.80
callMethod · 0.80

Tested by

no test coverage detected