mirror of https://github.com/databricks/cli.git
use apierr.ErrNotFound
This commit is contained in:
parent
7d544f4af4
commit
406c0736ff
|
@ -4,7 +4,6 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
|
||||||
"path"
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
@ -87,8 +86,7 @@ func filerForVolume(ctx context.Context, b *bundle.Bundle) (filer.Filer, string,
|
||||||
Paths: []dyn.Path{dyn.MustPathFromString("workspace.artifact_path")},
|
Paths: []dyn.Path{dyn.MustPathFromString("workspace.artifact_path")},
|
||||||
}
|
}
|
||||||
|
|
||||||
var aerr *apierr.APIError
|
if errors.Is(err, apierr.ErrNotFound) {
|
||||||
if errors.As(err, &aerr) && aerr.StatusCode == http.StatusNotFound {
|
|
||||||
path, locations, ok := findVolumeInBundle(b, catalogName, schemaName, volumeName)
|
path, locations, ok := findVolumeInBundle(b, catalogName, schemaName, volumeName)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, "", diag.Diagnostics{baseErr}
|
return nil, "", diag.Diagnostics{baseErr}
|
||||||
|
|
Loading…
Reference in New Issue