mirror of
https://github.com/3b1b/manim.git
synced 2025-08-03 04:04:36 +08:00
Add error message to LatexError
This commit is contained in:
@ -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
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user