aboutsummaryrefslogtreecommitdiff
path: root/src/debug
diff options
context:
space:
mode:
Diffstat (limited to 'src/debug')
-rw-r--r--src/debug/Tracer.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/debug/Tracer.ts b/src/debug/Tracer.ts
index 1e81691..4e17143 100644
--- a/src/debug/Tracer.ts
+++ b/src/debug/Tracer.ts
@@ -55,9 +55,10 @@ export const traceFunction = !IS_DEV
const traceName = mapper?.(...args) ?? name;
beginTrace(traceName, ...arguments);
- const result = f.apply(this, args);
- finishTrace(traceName);
-
- return result;
+ try {
+ return f.apply(this, args);
+ } finally {
+ finishTrace(traceName);
+ }
} as F;
};