Skip to content

Commit 56c99d9

Browse files
committed
Handle 404 in Exists
1 parent 63532ee commit 56c99d9

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

bundle/config/resources/vector_search_endpoint.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66

77
"github.com/databricks/cli/libs/log"
88
"github.com/databricks/databricks-sdk-go"
9+
"github.com/databricks/databricks-sdk-go/apierr"
910
"github.com/databricks/databricks-sdk-go/marshal"
1011
"github.com/databricks/databricks-sdk-go/service/vectorsearch"
1112
)
@@ -26,7 +27,10 @@ func (e VectorSearchEndpoint) MarshalJSON() ([]byte, error) {
2627
func (e *VectorSearchEndpoint) Exists(ctx context.Context, w *databricks.WorkspaceClient, name string) (bool, error) {
2728
_, err := w.VectorSearchEndpoints.GetEndpoint(ctx, vectorsearch.GetEndpointRequest{EndpointName: name})
2829
if err != nil {
29-
log.Debugf(ctx, "vector search endpoint %s does not exist", name)
30+
log.Debugf(ctx, "vector search endpoint %s does not exist: %v", name, err)
31+
if apierr.IsMissing(err) {
32+
return false, nil
33+
}
3034
return false, err
3135
}
3236
return true, nil

0 commit comments

Comments
 (0)