mirror of
https://github.com/lus/pasty.git
synced 2023-08-10 21:13:09 +03:00
Implement S3 missing object error handling
This commit is contained in:
parent
71e6baad95
commit
6b4563c7c9
1
.gitignore
vendored
1
.gitignore
vendored
@ -116,3 +116,4 @@ modules.xml
|
||||
|
||||
web/*.gz
|
||||
data/
|
||||
.env
|
@ -63,11 +63,11 @@ func (driver *S3Driver) Get(id string) (*pastes.Paste, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if object == nil {
|
||||
return nil, nil
|
||||
}
|
||||
data, err := ioutil.ReadAll(object)
|
||||
if err != nil {
|
||||
if minio.ToErrorResponse(err).Code == "NoSuchKey" {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user