dropbox: Don't retry 461 errors - fixes #551

461 errors from dropbox indicate some sort of copyright violation.
This commit is contained in:
Nick Craig-Wood 2016-07-04 13:45:10 +01:00
parent 606961f49d
commit f3e00133a0

View file

@ -710,6 +710,13 @@ func (o *Object) Storable() bool {
// Open an object for read // Open an object for read
func (o *Object) Open() (in io.ReadCloser, err error) { func (o *Object) Open() (in io.ReadCloser, err error) {
in, _, err = o.fs.db.Download(o.remotePath(), "", 0) in, _, err = o.fs.db.Download(o.remotePath(), "", 0)
if dropboxErr, ok := err.(*dropbox.Error); ok {
// Dropbox return 461 for copyright violation so don't
// attempt to retry this error
if dropboxErr.StatusCode == 461 {
return nil, fs.NoRetryError(err)
}
}
return return
} }