2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-25 14:17:42 +00:00

azure: fix totally broken IsNotExist

This commit is contained in:
Michael Eischer 2022-12-03 18:14:39 +01:00
parent 3ebdadc58f
commit 579cd6dc64

View File

@ -8,7 +8,6 @@ import (
"hash"
"io"
"net/http"
"os"
"path"
"strings"
@ -130,7 +129,8 @@ func (be *Backend) SetListMaxItems(i int) {
// IsNotExist returns true if the error is caused by a not existing file.
func (be *Backend) IsNotExist(err error) bool {
debug.Log("IsNotExist(%T, %#v)", err, err)
return os.IsNotExist(err)
var aerr storage.AzureStorageServiceError
return errors.As(err, &aerr) && aerr.StatusCode == http.StatusNotFound
}
// Join combines path components with slashes.