use apierr.ErrNotFound

This commit is contained in:
Shreyas Goenka 2024-12-02 11:48:04 +01:00
parent 7d544f4af4
commit 406c0736ff
No known key found for this signature in database
GPG Key ID: 92A07DF49CCB0622
1 changed files with 1 additions and 3 deletions

View File

@ -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}