-
Notifications
You must be signed in to change notification settings - Fork 762
Closed
Labels
closed-for-stalenessguidanceQuestion that needs advice or information.Question that needs advice or information.response-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 7 days.Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Description
- I've gone though the API reference
- I've checked AWS Forums and StackOverflow for answers
I found the following example in CHANGELOG:
// To get a specific API error
var notFoundErr *types.ResourceNotFoundException
if errors.As(err, ¬FoundErr) {
log.Printf("scan failed because the table was not found, %v", notFoundErr.ErrorMessage())
}So I tried this with RDS:
_, err := client.DescribeDBInstances(ctx, &rds.DescribeDBInstancesInput{
DBInstanceIdentifier: aws.String(identifier),
})
if err != nil {
var notFoundErr *types.DBInstanceNotFoundFault
// Doesn't work.
// I also tried using types.ResourceNotFoundFault.
if errors.As(err, ¬FoundErr) {
//
}
}This works:
var apiErr smithy.APIError
if errors.As(err, &apiErr) {
//
}Does this work as intended? Should I get 404 from response status code if I want to identify not found error?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
closed-for-stalenessguidanceQuestion that needs advice or information.Question that needs advice or information.response-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 7 days.Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.