Skip to content

Commit

Permalink
error handling improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
roaminro committed Dec 24, 2023
1 parent 9de25f0 commit 0506a87
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/localKoinos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,12 @@ export class LocalKoinos {
});
}

if (cmdResult.stderr.toString().trim().length) {
throw new Error(cmdResult.stderr.toString().trim());
if (cmdResult.status !== 0) {
throw new Error(
`An error occured while running the foolowing command: ${chalk.blue(
cmd
)}\n${chalk.red(cmdResult.stderr.toString().trim())}`
);
}
}

Expand Down

0 comments on commit 0506a87

Please sign in to comment.