Merge pull request #1405 from krishnasrinivas/return-client-type-perm-error

fs get() should return client.PathInsufficientPermission{} in case of EPERM error
This commit is contained in:
Harshavardhana
2015-11-17 19:56:55 -08:00
+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()