Skip to content

Commit 3f48f59

Browse files
authored
[Internal] Relax the check for "parent folder doesn't exist" error (#4690)
## Changes <!-- Summary of your changes that are easy to understand --> Check that parent folder doesn't exist in `databricks_notebook` and `databricks_workspace_file` is too specific and leads to an error in staging. This PR relax this check a bit to avoid problems. NO_CHANGELOG=true ## Tests <!-- How is this tested? Please see the checklist below and also describe any other relevant tests --> - [x] `make test` run locally - [ ] relevant change in `docs/` folder - [ ] covered with integration tests in `internal/acceptance` - [ ] using Go SDK - [ ] using TF Plugin Framework
1 parent 45b62e9 commit 3f48f59

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

workspace/resource_notebook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,6 @@ func ResourceNotebook() common.Resource {
401401
}
402402

403403
func isParentDoesntExistError(err error) bool {
404-
errStr := err.Error()
405-
return strings.HasPrefix(errStr, "The parent folder ") && strings.HasSuffix(errStr, " does not exist.")
404+
errStr := strings.ToLower(err.Error())
405+
return strings.Contains(errStr, "parent folder ") && strings.Contains(errStr, " does not exist")
406406
}

0 commit comments

Comments
 (0)