Skip to content

Commit

Permalink
fix: be more explicit when provision-one doesn't return JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Oct 8, 2020
1 parent 28b60b6 commit 0f0df62
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/agoric-cli/lib/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,9 +463,14 @@ export default async function startMain(progname, rawArgs, powers, opts) {
// eslint-disable-next-line no-await-in-loop
exitStatus = await capret[0];
if (!exitStatus) {
const ret = JSON.parse(capret[1]);
if (ret.code !== 0) {
exitStatus = 2;
try {
const ret = JSON.parse(capret[1]);
if (ret.code !== 0) {
exitStatus = 2;
}
} catch (e) {
console.error(`Cannot parse JSON:`, e, capret[1]);
exitStatus = 99;
}
}
}
Expand Down

0 comments on commit 0f0df62

Please sign in to comment.