mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
Improved error messages
This commit is contained in:
parent
15b96049ae
commit
009f62bde8
@ -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.`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user