Represents a collection of custom error definitions and a utility method for retrieving structured error details based on an error message.

Constructors

Methods

Constructors

Methods

  • Retrieves a structured error object based on a given result message.

    Parameters

    • resultMessage: string

      The error message to look up.

    Returns
        | null
        | {
            result: any;
            resultCode: number;
            resultMessage: string;
            resultMessageLarge: string;
            version: string;
        }

    An object containing the error details, including result codes, detailed messages, and additional metadata. If the error is not found, a default "unknown error" response is returned.

    const error = CustomErrors.getError("game not found");
    console.log(error);
    // {
    // resultCode: -1,
    // resultMessage: "game not found",
    // resultMessageLarge: "The provided game ID was not found. Have you entered the proper client configuration?",
    // result: null,
    // version: "4831_live"
    // }