From 6187b023875f3347586af9982c539acda2a3b777 Mon Sep 17 00:00:00 2001 From: ThomVui Date: Mon, 8 Jun 2020 04:01:26 +0200 Subject: [PATCH] Fix elif branch to actually show compiler errors (#65) --- src/commands/deploy.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/commands/deploy.ts b/src/commands/deploy.ts index 189d627..2762f41 100644 --- a/src/commands/deploy.ts +++ b/src/commands/deploy.ts @@ -141,11 +141,10 @@ export default class Deploy extends Command { if (deployResult.status === 'error') { throw new Error(`Unknown error occurred while deploying ${JSON.stringify(deployResult)}`); } else if (!deployResult.success) { - throw new Error(`Deployment error: ${ deployResult.error }`); - } - - if (deployResult.compilerErrors && deployResult.compilerErrors.length > 0) { - throw new Error(`Deployment compiler errors: \n${ JSON.stringify(deployResult.compilerErrors, null, 2) }`); + if (deployResult.status === 'compiler_error') { + throw new Error(`Deployment compiler errors: \n${ JSON.stringify(deployResult.messages, null, 2) }`); + } + throw new Error(`Deployment error: ${ deployResult }`); } } -- GitLab