From 406c0736ffa560739c2ef30982f8d247a4d47a01 Mon Sep 17 00:00:00 2001 From: Shreyas Goenka Date: Mon, 2 Dec 2024 11:48:04 +0100 Subject: [PATCH] use apierr.ErrNotFound --- bundle/libraries/filer_volume.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bundle/libraries/filer_volume.go b/bundle/libraries/filer_volume.go index f3a6fdbe..1ef8d401 100644 --- a/bundle/libraries/filer_volume.go +++ b/bundle/libraries/filer_volume.go @@ -4,7 +4,6 @@ import ( "context" "errors" "fmt" - "net/http" "path" "strings" @@ -87,8 +86,7 @@ func filerForVolume(ctx context.Context, b *bundle.Bundle) (filer.Filer, string, Paths: []dyn.Path{dyn.MustPathFromString("workspace.artifact_path")}, } - var aerr *apierr.APIError - if errors.As(err, &aerr) && aerr.StatusCode == http.StatusNotFound { + if errors.Is(err, apierr.ErrNotFound) { path, locations, ok := findVolumeInBundle(b, catalogName, schemaName, volumeName) if !ok { return nil, "", diag.Diagnostics{baseErr}