Improved error messages

This commit is contained in:
Stan Wohlwend 2024-07-25 09:32:12 -07:00
parent 15b96049ae
commit 009f62bde8
2 changed files with 2 additions and 2 deletions

View File

@ -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.`,
);
}
}

View File

@ -19,7 +19,7 @@ export function throwErr(...args: any[]): never {
export class StackAssertionError extends Error {
constructor(message: string, public readonly extraData?: Record<string, any>, 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);
}
}