drive: check errors in Open() better
This commit is contained in:
parent
c1a245d1c8
commit
66cf2df780
1 changed files with 4 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue