mirror of
https://github.com/rocky-linux/srpmproc.git
synced 2024-12-04 18:36:26 +00:00
fix: s3 not found should not return an error
This commit is contained in:
parent
1e769f96dd
commit
7c15c41a9f
@ -23,6 +23,7 @@ package s3
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||
"github.com/aws/aws-sdk-go/aws/credentials"
|
||||
"github.com/aws/aws-sdk-go/aws/session"
|
||||
"github.com/aws/aws-sdk-go/service/s3"
|
||||
@ -89,7 +90,10 @@ func (s *S3) Read(path string) ([]byte, error) {
|
||||
Key: aws.String(path),
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
s3err, ok := err.(awserr.Error)
|
||||
if !ok || s3err.Code() != s3.ErrCodeNoSuchKey {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
body, err := ioutil.ReadAll(obj.Body)
|
||||
|
Loading…
Reference in New Issue
Block a user