Skip to content

Commit

Permalink
handle errors in options better
Browse files Browse the repository at this point in the history
  • Loading branch information
Geoffrey Hendrey committed Feb 18, 2024
1 parent 383eae8 commit 437d5fa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/CliCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ export default class CliCore {
}else {
tags = tags.split(',').map(s => s.trim()); //tags are provided as JSON array
}
options = JSON.parse(options);
try {
options = JSON.parse(options);
}catch(e){
console.error("failed to parse --options json: " + e.message);
throw e;
}

filepath = filepath?filepath:bareArgs[0];
oneshot = oneshot===true?oneshot:bareArgs.length > 0;
Expand Down

0 comments on commit 437d5fa

Please sign in to comment.