I'm on 3d7575d4.
The documentation claims that if a key is not found, an error with code s3. ErrCodeNoSuchKey is returned. s3. ErrCodeNoSuchKey is NoSuchKey whereas the actual error returned is NotFound, which means my error check will not match. There is also no const for NotFound.
Thanks for contacting us @bsdlp. It looks like the service is modeling this error incorrectly modeling the NotSuchKey error code as being returned from this API operation. I'll reach out to the service team to see if they can update this documentation.
In the meantime the S3 service will return a 404 ("NotFound") when the key does not exist, and 400 ("BadRequest") in other cases such as the bucket doesn't exist.
Any update on this?
https://github.com/aws/aws-sdk-go/pull/1220 claims to fix this issue but I don't see how. From what I can see there is no defined error for "NotFound" yet (do you mind if I at least add an ErrNotFound to service/s3/errors.go that can be checked?)
@jasdel ,
Was this issue closed in error?
Most helpful comment
Any update on this?