From 38eb7776537c180edd6f39ebe461a62265c20dff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Wed, 22 May 2024 17:35:26 +0200 Subject: [PATCH 1/2] Quick fix for uncaught 409 on slug conflict. --- src/deploy.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/deploy.ts b/src/deploy.ts index 642ca4d6e..31c18c3ac 100644 --- a/src/deploy.ts +++ b/src/deploy.ts @@ -330,7 +330,12 @@ export async function deploy( ); } else { clack.log.error( - wrapAnsi(`Could not create project: ${error instanceof Error ? error.message : error}`, effects.outputColumns) + wrapAnsi( + `Could not create project: ${ + (error as any)?.statusCode === 409 ? "conflicting slug." : error instanceof Error ? error.message : error + }`, + effects.outputColumns + ) ); } clack.outro(yellow("Deploy canceled")); From 8c58dea58d85d81d0d5f8258542b576cbc24663d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Mon, 11 Nov 2024 16:18:10 +0100 Subject: [PATCH 2/2] fix merge --- src/deploy.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/deploy.ts b/src/deploy.ts index 994384b99..00ba0a417 100644 --- a/src/deploy.ts +++ b/src/deploy.ts @@ -374,7 +374,13 @@ class Deployer { } else { this.effects.clack.log.error( wrapAnsi( - `Could not create app: ${error instanceof Error ? error.message : error}`, + `Could not create app: ${ + isHttpError(error) && error.statusCode === 409 + ? "conflicting slug." + : error instanceof Error + ? error.message + : error + }`, this.effects.outputColumns ) ); @@ -471,14 +477,7 @@ class Deployer { doBuild = true; } } else { - clack.log.error( - wrapAnsi( - `Could not create project: ${ - (error as any)?.statusCode === 409 ? "conflicting slug." : error instanceof Error ? error.message : error - }`, - effects.outputColumns - ) - ); + throw error; } }