File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 11import type { CloudFormationClient } from '@aws-sdk/client-cloudformation' ;
22import { AwsCredentials } from './awsCredentials.js' ;
33import { AwsConfiguration } from './types/awsConfiguration.js' ;
4+ import { Logger } from './logger.js' ;
45
56let cloudFormationClient : CloudFormationClient ;
67
@@ -29,10 +30,11 @@ async function getCloudFormationStackTemplate(
2930 return cfTemplate ;
3031 } catch ( error : any ) {
3132 if ( error . name === 'ValidationError' ) {
32- throw new Error (
33+ Logger . error (
3334 `Stack ${ stackName } not found. Try specifying a region. Error: ${ error . message } ` ,
34- { cause : error } ,
35+ error ,
3536 ) ;
37+ return undefined ;
3638 } else {
3739 throw error ;
3840 }
@@ -81,10 +83,11 @@ async function getCloudFormationResources(
8183 return response ;
8284 } catch ( error : any ) {
8385 if ( error . name === 'ValidationError' ) {
84- throw new Error (
86+ Logger . error (
8587 `Stack ${ stackName } not found. Try specifying a region. Error: ${ error . message } ` ,
86- { cause : error } ,
88+ error ,
8789 ) ;
90+ return undefined ;
8891 } else {
8992 throw error ;
9093 }
@@ -110,7 +113,7 @@ async function getLambdasInStack(
110113 stackName ,
111114 awsConfiguration ,
112115 ) ;
113- const lambdaResources = response . StackResourceSummaries ?. filter (
116+ const lambdaResources = response ? .StackResourceSummaries ?. filter (
114117 ( resource ) => resource . ResourceType === 'AWS::Lambda::Function' ,
115118 ) ;
116119
You can’t perform that action at this time.
0 commit comments