diff options
Diffstat (limited to 'common/docserver/docserver.go')
-rw-r--r-- | common/docserver/docserver.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/common/docserver/docserver.go b/common/docserver/docserver.go index dac542ba7..cfc4e3b26 100644 --- a/common/docserver/docserver.go +++ b/common/docserver/docserver.go @@ -95,14 +95,20 @@ func (self *DocServer) Get(uri, path string) (content []byte, err error) { resp.Body.Close() } }() + if err != nil { return } + content, err = ioutil.ReadAll(resp.Body) if err != nil { return } + if resp.StatusCode/100 != 2 { + return content, fmt.Errorf("HTTP error: %s", resp.Status) + } + if path != "" { var abspath string abspath, err = filepath.Abs(path) |