File tree Expand file tree Collapse file tree 1 file changed +0
-27
lines changed
packages/node/src/integrations/tracing/firebase/otel/patches Expand file tree Collapse file tree 1 file changed +0
-27
lines changed Original file line number Diff line number Diff line change @@ -98,33 +98,6 @@ export function patchFunctions(
9898 return moduleFunctionsCJS ;
9999}
100100
101- /**
102- * Async function to execute patched function and being able to catch errors
103- * @param execute - function to be executed
104- * @param onFinish - callback to run when execute finishes
105- */
106- export async function safeExecuteInTheMiddleAsync < T > (
107- execute : ( ) => T ,
108- onFinish : ( e : Error | undefined , result : T | undefined ) => Promise < void > | void ,
109- preventThrowingError ?: boolean ,
110- ) : Promise < T > {
111- let error : Error | undefined ;
112- let result : T | undefined ;
113- try {
114- result = await execute ( ) ;
115- } catch ( e ) {
116- error = e as Error ;
117- } finally {
118- await onFinish ?.( error , result ) ;
119- if ( error && ! preventThrowingError ) {
120- // eslint-disable-next-line no-unsafe-finally
121- throw error ;
122- }
123- // eslint-disable-next-line no-unsafe-finally
124- return result as T ;
125- }
126- }
127-
128101/**
129102 * Patches Cloud Functions for Firebase (v2) to add OpenTelemetry instrumentation
130103 *
You can’t perform that action at this time.
0 commit comments