From 1dc92bb03475d406637978812980fce0311bd5a0 Mon Sep 17 00:00:00 2001 From: Neil Macneale V Date: Thu, 28 Sep 2023 13:18:49 -0700 Subject: [PATCH 1/2] Emit an error when there are no DBs within an endpoint --- src/lib/stack-factory.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/stack-factory.ts b/src/lib/stack-factory.ts index 4a2f2e34..250694b8 100644 --- a/src/lib/stack-factory.ts +++ b/src/lib/stack-factory.ts @@ -115,6 +115,8 @@ export class StackFactory { }); await client.close(); return res; + } else if (databasePaths.length === 0) { + this.cmd.error("No databases found in the given endpoint"); } else { await client.close(); return searchSelect({ From f33cd9a88c2bfba9daee05748809266ef9a146ef Mon Sep 17 00:00:00 2001 From: Neil Macneale V Date: Thu, 28 Sep 2023 13:19:33 -0700 Subject: [PATCH 2/2] Cleanup error message --- src/lib/stack-factory.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/stack-factory.ts b/src/lib/stack-factory.ts index 250694b8..856de959 100644 --- a/src/lib/stack-factory.ts +++ b/src/lib/stack-factory.ts @@ -97,7 +97,7 @@ export class StackFactory { const res = await client.query("0"); if (res.status !== 200) { - this.cmd.error(`Error: ${res.body.error.code}`); + this.cmd.error(`${res.body.error.code}`); } const databasePaths = await this.getDatabasePaths(client);