From 009f62bde816a16e0d0f6064c15e23460f478f4d Mon Sep 17 00:00:00 2001 From: Stan Wohlwend Date: Thu, 25 Jul 2024 09:32:12 -0700 Subject: [PATCH] Improved error messages --- apps/backend/src/route-handlers/smart-route-handler.tsx | 2 +- packages/stack-shared/src/utils/errors.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/backend/src/route-handlers/smart-route-handler.tsx b/apps/backend/src/route-handlers/smart-route-handler.tsx index 78d6d85cd..979f0c675 100644 --- a/apps/backend/src/route-handlers/smart-route-handler.tsx +++ b/apps/backend/src/route-handlers/smart-route-handler.tsx @@ -16,7 +16,7 @@ class InternalServerError extends StatusError { constructor(error: unknown) { super( StatusError.InternalServerError, - ["development", "test"].includes(getNodeEnvironment()) ? `Internal Server Error. The error message follows, but will be stripped in production. ${error}` : undefined, + ["development", "test"].includes(getNodeEnvironment()) ? `Internal Server Error. The error message follows, but will be stripped in production. ${error}` : `Something went wrong. Please make sure the data you entered is correct.`, ); } } diff --git a/packages/stack-shared/src/utils/errors.tsx b/packages/stack-shared/src/utils/errors.tsx index fb48591cd..e25ccdee9 100644 --- a/packages/stack-shared/src/utils/errors.tsx +++ b/packages/stack-shared/src/utils/errors.tsx @@ -19,7 +19,7 @@ export function throwErr(...args: any[]): never { export class StackAssertionError extends Error { constructor(message: string, public readonly extraData?: Record, options?: ErrorOptions) { - const disclaimer = `\n\nThis is likely an error in Stack. Please report it.`; + const disclaimer = `\n\nThis is likely an error in Stack. Please make sure you are running the newest version and report it.`; super(`${message}${message.endsWith(disclaimer) ? "" : disclaimer}`, options); } }