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 1
1
import type { CloudFormationClient } from '@aws-sdk/client-cloudformation' ;
2
2
import { AwsCredentials } from './awsCredentials.js' ;
3
3
import { AwsConfiguration } from './types/awsConfiguration.js' ;
4
+ import { Logger } from './logger.js' ;
4
5
5
6
let cloudFormationClient : CloudFormationClient ;
6
7
@@ -29,10 +30,11 @@ async function getCloudFormationStackTemplate(
29
30
return cfTemplate ;
30
31
} catch ( error : any ) {
31
32
if ( error . name === 'ValidationError' ) {
32
- throw new Error (
33
+ Logger . error (
33
34
`Stack ${ stackName } not found. Try specifying a region. Error: ${ error . message } ` ,
34
- { cause : error } ,
35
+ error ,
35
36
) ;
37
+ return undefined ;
36
38
} else {
37
39
throw error ;
38
40
}
@@ -81,10 +83,11 @@ async function getCloudFormationResources(
81
83
return response ;
82
84
} catch ( error : any ) {
83
85
if ( error . name === 'ValidationError' ) {
84
- throw new Error (
86
+ Logger . error (
85
87
`Stack ${ stackName } not found. Try specifying a region. Error: ${ error . message } ` ,
86
- { cause : error } ,
88
+ error ,
87
89
) ;
90
+ return undefined ;
88
91
} else {
89
92
throw error ;
90
93
}
@@ -110,7 +113,7 @@ async function getLambdasInStack(
110
113
stackName ,
111
114
awsConfiguration ,
112
115
) ;
113
- const lambdaResources = response . StackResourceSummaries ?. filter (
116
+ const lambdaResources = response ? .StackResourceSummaries ?. filter (
114
117
( resource ) => resource . ResourceType === 'AWS::Lambda::Function' ,
115
118
) ;
116
119
You can’t perform that action at this time.
0 commit comments