renderError = function(
    error,
    expression: string,
    options: Settings,
) {
    if (options.throwOnError || !(error instanceof ParseError)) {
        throw error;
    }
    const node = buildCommon.makeSpan(["katex-error"],
        [new SymbolNode(expression)]);
    node.setAttribute("title", error.toString());
    node.setAttribute("style", `color:${options.errorColor}`);
    return node;
}
If the given error is a KaTeX ParseError and options.throwOnError is false,
renders the invalid LaTeX as a span with hover title giving the KaTeX
error message.  Otherwise, simply throws the error.