Skip to content

Commit 27886a1

Browse files
Merge pull request #52 from ServerlessLife/49-fix-sam-useless-errors
fix: [#49] SAM useless errors
2 parents afce0ba + c1b3819 commit 27886a1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/cloudFormation.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,13 @@ async function getCloudFormationResources(
7373
stackName: string,
7474
awsConfiguration: AwsConfiguration,
7575
) {
76+
// temporary disable console.error because SAM framework outputs useless errors
77+
const originalConsoleError = console.error;
78+
console.error = function () {};
7679
const { ListStackResourcesCommand } = await import(
7780
'@aws-sdk/client-cloudformation'
7881
);
82+
console.error = originalConsoleError;
7983

8084
const cloudFormationClient: CloudFormationClient =
8185
await getCloudFormationClient(awsConfiguration);

0 commit comments

Comments
 (0)