diff --git a/pkg/azurestore/azurestore.go b/pkg/azurestore/azurestore.go index a63d959..d21cbf0 100644 --- a/pkg/azurestore/azurestore.go +++ b/pkg/azurestore/azurestore.go @@ -112,8 +112,12 @@ func (store AzureStore) GetUpload(ctx context.Context, id string) (handler.Uploa } offset, err := blockBlob.GetOffset(ctx) - if err != nil && err != handler.ErrNotFound { - return nil, err + if err != nil { + // Unpack the error and see if it is a handler.ErrNotFound by comparing the + // error code. If it matches, we ignore the error, otherwise we return the error. + if handlerErr, ok := err.(handler.Error); !ok || handlerErr.ErrorCode != handler.ErrNotFound.ErrorCode { + return nil, err + } } info.Offset = offset diff --git a/pkg/handler/error.go b/pkg/handler/error.go index f4a518e..670fe2c 100644 --- a/pkg/handler/error.go +++ b/pkg/handler/error.go @@ -3,6 +3,8 @@ package handler // Error represents an error with the intent to be sent in the HTTP // response to the client. Therefore, it also contains a HTTPResponse, // next to an error code and error message. +// TODO: Error is not comparable anymore because HTTPResponse +// contains a map. See if we should change this. type Error struct { ErrorCode string Message string