Skip to content

Commit c704fef

Browse files
committedDec 18, 2024·
fix: capture stacktrace of thrown errors
1 parent e049ce6 commit c704fef

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎src/drivers/utils/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ export function createError(
3131
opts?: ErrorOptions
3232
) {
3333
const err = new Error(`[unstorage] [${driver}] ${message}`, opts);
34+
if (Error.captureStackTrace) {
35+
Error.captureStackTrace(err, createError);
36+
}
3437
return err;
3538
}
3639

0 commit comments

Comments
 (0)
Please sign in to comment.