drive: check errors in Open() better

This commit is contained in:
Nick Craig-Wood 2014-07-15 11:15:48 +01:00
parent c1a245d1c8
commit 66cf2df780

View file

@ -929,7 +929,10 @@ func (o *FsObjectDrive) Storable() bool {
// Open an object for read
func (o *FsObjectDrive) Open() (in io.ReadCloser, err error) {
req, _ := http.NewRequest("GET", o.url, nil)
req, err := http.NewRequest("GET", o.url, nil)
if err != nil {
return nil, err
}
req.Header.Set("User-Agent", fs.UserAgent)
res, err := o.drive.client.Do(req)
if err != nil {