From 22d6b951013304cb003dbdc2684c902645f604e9 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Thu, 28 Nov 2024 15:39:16 +0000 Subject: [PATCH] Put errors back how they were. --- packages/server/src/api/controllers/table/external.ts | 2 +- packages/server/src/sdk/app/rows/search/internal/sqs.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/server/src/api/controllers/table/external.ts b/packages/server/src/api/controllers/table/external.ts index 5e77dc1dc6..6f09bf4a61 100644 --- a/packages/server/src/api/controllers/table/external.ts +++ b/packages/server/src/api/controllers/table/external.ts @@ -54,7 +54,7 @@ export async function updateTable( return table } catch (err: any) { if (err instanceof Error) { - throw err + ctx.throw(400, err.message) } else { ctx.throw(err.status || 500, err?.message || err) } diff --git a/packages/server/src/sdk/app/rows/search/internal/sqs.ts b/packages/server/src/sdk/app/rows/search/internal/sqs.ts index ba5614edca..9bfa0ecd27 100644 --- a/packages/server/src/sdk/app/rows/search/internal/sqs.ts +++ b/packages/server/src/sdk/app/rows/search/internal/sqs.ts @@ -485,7 +485,6 @@ export async function search( if (err.status === 400 && msg?.match(MISSING_COLUMN_REGEX)) { return { rows: [] } } - // throw new Error(`Unable to search by SQL - ${msg}`, { cause: err }) - throw err + throw new Error(`Unable to search by SQL - ${msg}`, { cause: err }) } }