diff --git a/pageindex/backend/cloud.py b/pageindex/backend/cloud.py index 81c1cde..c44e892 100644 --- a/pageindex/backend/cloud.py +++ b/pageindex/backend/cloud.py @@ -205,13 +205,14 @@ class CloudBackend: except CollectionNotFoundError: return # already gone — delete is idempotent if folder_id: - self._request("DELETE", f"/folder/{self._enc(folder_id)}/") - # Drop the cached id so a later same-name op re-resolves instead of - # reusing the now-deleted folder_id. Only when it was a REAL id — - # if folder_id was falsy, the cache holds the "folders unavailable - # on this plan" None sentinel, which must survive so we don't - # re-issue a doomed GET /folders/ on the next call. - self._folder_id_cache.pop(name, None) + # The cloud API has no folder-deletion endpoint (only POST /folder + # and GET /folders exist) — fail clearly instead of issuing a + # request that can only 404. + raise PageIndexError( + f"Deleting a cloud collection is not supported by the PageIndex " + f"API — delete folder '{name}' in the dashboard " + "(https://dash.pageindex.ai) instead." + ) # ── Document management ───────────────────────────────────────────────