Skip to content

Commit a431a54

Browse files
committed
fixup! feat(firebase): add error handling and rename hooks to align with otel standards
1 parent c2cb176 commit a431a54

File tree

1 file changed

+0
-27
lines changed
  • packages/node/src/integrations/tracing/firebase/otel/patches

1 file changed

+0
-27
lines changed

packages/node/src/integrations/tracing/firebase/otel/patches/functions.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff 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
*

0 commit comments

Comments
 (0)