From 0f0df6282a1ae6586f0d19b6be89ce8e05c14e19 Mon Sep 17 00:00:00 2001 From: Michael FIG Date: Thu, 8 Oct 2020 16:50:06 -0600 Subject: [PATCH] fix: be more explicit when provision-one doesn't return JSON --- packages/agoric-cli/lib/start.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/agoric-cli/lib/start.js b/packages/agoric-cli/lib/start.js index bcc965a4d92..db934f49b6a 100644 --- a/packages/agoric-cli/lib/start.js +++ b/packages/agoric-cli/lib/start.js @@ -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; } } }