fix: handle sdk ServerError InvalidDBInstanceId.NotFound when instance not present.
Description of your changes
When DB Instance is not present in RDS the DescribeDBInstances api will throw ServerError with errorMessage InvalidDBInstanceId.NotFound. This will broke the Observe() and Delete() Logic. The Change as follow will check the error type and content, make sure thow the right type of error.
func errorConvert(err error) error {
if e, ok := err.(*sdkErrors.ServerError); ok && e.ErrorCode() == ErrCodeInstanceNotFound {
return ErrDBInstanceNotFound
}
return err
}
fix: handle sdk ServerError InvalidDBInstanceId.NotFound when instance not present.
Description of your changes
When DB Instance is not present in RDS the DescribeDBInstances api will throw ServerError with errorMessage InvalidDBInstanceId.NotFound. This will broke the Observe() and Delete() Logic. The Change as follow will check the error type and content, make sure thow the right type of error.
Fixes #
I have:
make reviewable test
to ensure this PR is ready for review.How has this code been tested
TAB