From b2da734ec9efa8701e0400abc1a0fecc134102ef Mon Sep 17 00:00:00 2001 From: Krishna Srinivas Date: Tue, 17 Nov 2015 19:51:57 -0800 Subject: [PATCH] fs get() should return client.PathInsufficientPermission{} in case of EPERM error --- pkg/client/fs/fs.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/client/fs/fs.go b/pkg/client/fs/fs.go index a263eff4..95677fb5 100644 --- a/pkg/client/fs/fs.go +++ b/pkg/client/fs/fs.go @@ -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()