From 579cd6dc6469ccc141af96682fd45eb7b417738b Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sat, 3 Dec 2022 18:14:39 +0100 Subject: [PATCH] azure: fix totally broken IsNotExist --- internal/backend/azure/azure.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/backend/azure/azure.go b/internal/backend/azure/azure.go index 7e9b64679..9e1c64c47 100644 --- a/internal/backend/azure/azure.go +++ b/internal/backend/azure/azure.go @@ -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.