s3: Error message for objects in glacier

This commit is contained in:
Jan Varho 2017-09-09 15:02:26 +03:00 committed by Nick Craig-Wood
parent f91f89d409
commit c22be38747

View File

@ -949,6 +949,11 @@ func (o *Object) Open(options ...fs.OpenOption) (in io.ReadCloser, err error) {
}
}
resp, err := o.fs.c.GetObject(&req)
if err, ok := err.(awserr.RequestFailure); ok {
if err.Code() == "InvalidObjectState" {
return nil, errors.Errorf("Object in GLACIER, restore first: %v", key)
}
}
if err != nil {
return nil, err
}