fs get() should return client.PathInsufficientPermission{} in case of EPERM error

This commit is contained in:
Krishna Srinivas
2015-11-17 19:51:57 -08:00
parent a7c02c675e
commit b2da734ec9
+3
View File
@@ -152,6 +152,9 @@ func (f *fsClient) Put(size int64, data io.Reader) *probe.Error {
func (f *fsClient) get() (io.ReadCloser, int64, *probe.Error) {
body, e := os.Open(f.PathURL.Path)
if e != nil {
if os.IsPermission(e) {
return nil, 0, probe.NewError(client.PathInsufficientPermission{Path: f.PathURL.Path})
}
return nil, 0, probe.NewError(e)
}
content, err := f.getFSMetadata()