From f741596191a379c41600e167fbbcd182cc552eb8 Mon Sep 17 00:00:00 2001 From: Taylor Fahlman Date: Mon, 24 Oct 2022 15:20:06 -0400 Subject: [PATCH] Add specific error message to suggest cleanup of leftover SG --- pkg/verifier/aws/entry_point.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/verifier/aws/entry_point.go b/pkg/verifier/aws/entry_point.go index f68b3eab..370ed7c3 100644 --- a/pkg/verifier/aws/entry_point.go +++ b/pkg/verifier/aws/entry_point.go @@ -104,7 +104,9 @@ func (a *AwsVerifier) ValidateEgress(vei verifier.ValidateEgressInput) *output.O if cleanupSecurityGroup { _, err := a.AwsClient.DeleteSecurityGroup(vei.Ctx, &ec2.DeleteSecurityGroupInput{GroupId: awsTools.String(vei.AWS.SecurityGroupId)}) if err != nil { - a.Output.AddError(err) + a.Output.AddError(handledErrors.NewGenericError(err)) + a.Output.AddException(handledErrors.NewGenericError(fmt.Errorf("unable to cleanup security group %s, please manually clean up", vei.AWS.SecurityGroupId))) + } }