Skip to content

Commit

Permalink
fix: capture stacktrace of thrown errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Dec 18, 2024
1 parent e049ce6 commit c704fef
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/drivers/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export function createError(
opts?: ErrorOptions
) {
const err = new Error(`[unstorage] [${driver}] ${message}`, opts);
if (Error.captureStackTrace) {
Error.captureStackTrace(err, createError);
}
return err;
}

Expand Down

0 comments on commit c704fef

Please sign in to comment.