fix: Cannot read properties of undefined (reading 'message')
This commit is contained in:
@@ -106,8 +106,10 @@ export const traceFunction = (config: TraceConfig) => <
|
|||||||
|
|
||||||
if (output && typeof output.then === "function") {
|
if (output && typeof output.then === "function") {
|
||||||
output
|
output
|
||||||
.catch((error: Error) => {
|
.catch((error: Error | undefined) => {
|
||||||
Tracing.setError(error, span);
|
if (error instanceof Error) {
|
||||||
|
Tracing.setError(error, span);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
span.finish();
|
span.finish();
|
||||||
|
|||||||
Reference in New Issue
Block a user