Skip to content

Commit

Permalink
feat: more sensible error codes (#189)
Browse files Browse the repository at this point in the history
* More sensible error codes
  • Loading branch information
s-baumann authored Aug 8, 2024
1 parent 1ce9a7e commit d0fe496
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@
"engines": {
"node": ">=12"
}
}
}
4 changes: 2 additions & 2 deletions src/cli/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,11 @@ export async function run(argv: NodeJS.Process['argv']) {
'Search config invalid:',
validationErrors.map(err => err?.message || '')
);
process.exit(0);
process.exit(1);
}
} catch (err: unknown) {
const errorMsg = err instanceof Error ? err.message : JSON.stringify(err);
printErrors('\nSomething went wrong:', errorMsg);
process.exit(0);
process.exit(1);
}
}
2 changes: 1 addition & 1 deletion src/utils/MemoryUsageReporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ export class MemoryUsageReporter {
console.log('Stopping memory usage tracker', reason);
clearInterval(this.interval);
this.interval = null;
process.exit(0);
process.exit(1);
}
}

0 comments on commit d0fe496

Please sign in to comment.