From f32568fa6a832286b85976b6035ec86b86dafd0b Mon Sep 17 00:00:00 2001 From: hazelnutcloud Date: Wed, 5 Apr 2023 12:35:08 +0800 Subject: [PATCH] signup username already exists error message --- cli/signup/mod.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cli/signup/mod.ts b/cli/signup/mod.ts index a4a94da..344cfed 100644 --- a/cli/signup/mod.ts +++ b/cli/signup/mod.ts @@ -44,6 +44,14 @@ export const action = async (options: { }, }); if (signUpRes.error) { + if ( + signUpRes.error.message.includes( + "Username already exists!", + ) + ) { + spinner.fail("Username already taken, please try another one"); + Deno.exit(1); + } spinner.fail("Signup failed"); throw signUpRes.error; }