Better minijinja Error Messages
May 2024
-
Add
debugto the Cargo.toml dependency -
Use
:#in the error message strings
---
minijinja =
---
use ;
Output:
<html><head><style>body {{ background-color: black; color: goldenrod; }}</style></head><body><pre>
A MiniJinja error occurred
Could not render template:
template not found: tried to include non-existing template "asdf" (in hello:1)
------------------------------------ hello ------------------------------------
1 > {% include 'asdf' %}
i ^^^^^^^^^^^^^^ template not found
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
No referenced variables
-------------------------------------------------------------------------------</p>
</pre></body></html>
end of line