diff --git a/lib/actions/EndpointDeploy.js b/lib/actions/EndpointDeploy.js index 76602da62..9b94a33cc 100644 --- a/lib/actions/EndpointDeploy.js +++ b/lib/actions/EndpointDeploy.js @@ -263,11 +263,27 @@ module.exports = function(SPlugin, serverlessPath) { SCli.log('Successfully deployed endpoints in "' + evt.stage + '" to the following regions:'); // Display Methods & URLS - for (let i = 0; i < Object.keys(evt.deployed).length; i++) { - let region = evt.deployed[Object.keys(evt.deployed)[i]]; - SCli.log(Object.keys(evt.deployed)[i] + ' ------------------------'); - for (let j = 0; j < region.length; j++) { - SCli.log(' ' + region[j].method + ' - ' + region[j].url); + if( evt.deployed ){ + for (let i = 0; i < Object.keys(evt.deployed).length; i++) { + let region = evt.deployed[Object.keys(evt.deployed)[i]]; + SCli.log(Object.keys(evt.deployed)[i] + ' ------------------------'); + for (let j = 0; j < region.length; j++) { + SCli.log(' ' + region[j].method + ' - ' + region[j].url); + } + } + } + + if( evt.failed ){ + SCli.log('FAILED to deploy endpoints in "' + evt.stage + '" to the following regions:'); + + // Display Methods & URLS + for (let i = 0; i < Object.keys(evt.failed).length; i++) { + let region = evt.failed[Object.keys(evt.failed)[i]]; + SCli.log(Object.keys(evt.failed)[i] + ' ------------------------'); + for (let j = 0; j < region.length; j++) { + SCli.log(' ' + region[j].endpoint.method + ' - ' + region[j].endpoint.path + ': ' + region[j].message ); + SUtils.sDebug(region[j].stack); + } } }