b2: fixed provider bug which was revealed after
"fmt"
"io/ioutil"
"net/http"
+ "strings"
"time"
"github.com/efarrer/iothrottler"
@@ -130,6 +131,11 @@ func translateError(err error) error {
return blob.ErrBlobNotFound
}
+ if b2err.Code == "bad_request" && strings.HasPrefix(b2err.Message, "Bad fileId") {
+ // returned in GetMetadata() when fileId is not found.
+ return blob.ErrBlobNotFound
+ }
+
case http.StatusRequestedRangeNotSatisfiable:
return blob.ErrInvalidRange
}
