Function isErrorWithMessage

  • Type guard for determining whether the given value is an error object with a message property, such as an instance of Error.

    Returns

    A boolean.

    Parameters

    • error: unknown

      The object to check.

    Returns error is {
        message: string;
    }