From 2b104a46fde1e9f75486f0213f1cc5be183278b1 Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Wed, 27 Apr 2022 09:55:15 -0700 Subject: [PATCH] Add error message to LatexError --- manimlib/utils/tex_file_writing.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/manimlib/utils/tex_file_writing.py b/manimlib/utils/tex_file_writing.py index 557d08be..e700de9d 100644 --- a/manimlib/utils/tex_file_writing.py +++ b/manimlib/utils/tex_file_writing.py @@ -90,11 +90,13 @@ def tex_to_dvi(tex_file: str) -> str: if exit_code != 0: log_file = tex_file.replace(".tex", ".log") log.error("LaTeX Error! Not a worry, it happens to the best of us.") + error_str = "" with open(log_file, "r", encoding="utf-8") as file: for line in file.readlines(): if line.startswith("!"): - log.debug(f"The error could be: `{line[2:-1]}`") - raise LatexError() + error_str = line[2:-1] + log.debug(f"The error could be: `{error_str}`") + raise LatexError(error_str) return result