fix: surface a broken folder rule in the cli instead of naming the deployer

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
hugocasa
2026-10-21 18:25:44 +02:00
co-authored by Claude Opus 5.5
parent 77e31d2852
commit 7371cfcaa8
+5 -3
View File
@@ -66,7 +66,8 @@ function deployer(workspace: string) {
/**
* The folder rule the server applies to a create at `path`. A server without the lookup route
* answers with an error, read as no rule.
* answers 404, read as no rule. Any other error, such as a rule naming a removed user, is thrown:
* read as no rule, it would deploy as the pusher where the server refuses the create.
*/
export async function folderDefaultPermissionedAs(
workspace: string,
@@ -75,8 +76,9 @@ export async function folderDefaultPermissionedAs(
if (!path.startsWith("f/")) return undefined;
try {
return (await wmill.getFolderDefaultPermissionedAs({ workspace, path }))?.permissioned_as;
} catch {
return undefined;
} catch (e: any) {
if (e?.status === 404) return undefined;
throw e;
}
}