xxxxxxxxxx
import "log"
import "github.com/aws/smithy-go"
// ...
if err != nil {
var oe *smithy.OperationError
if errors.As(err, &oe) {
log.Printf("failed to call service: %s, operation: %s, error: %v", oe.Service(), oe.Operation(), oe.Unwrap())
}
return
}
xxxxxxxxxx
import "log"
import "github.com/aws/aws-sdk-go-v2/service/s3/types"
// ...
if err != nil {
var bne *types.BucketAlreadyExists
if errors.As(err, &bne) {
log.Println("error:", bne)
}
return
}