Skip to content

Commit

Permalink
fix: don't destructure error object
Browse files Browse the repository at this point in the history
  • Loading branch information
kanadgupta committed Nov 15, 2024
1 parent f6d9d94 commit 2190a61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export async function captureOutput<T>(fn: () => Promise<unknown>, opts?: Captur
} catch (error) {
return {
...(error instanceof Errors.CLIError && {error: {...error, message: toString(error.message)}}),
...(error instanceof Error && {error: {...error, message: toString(error.message)}}),
...(error instanceof Error && {error}),
stderr: getStderr(),
stdout: getStdout(),
}
Expand Down

0 comments on commit 2190a61

Please sign in to comment.