-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve template error reporting #23396
Improve template error reporting #23396
Conversation
I've marked this as backport because it's precisely the kind of feature that is helpful to be backported. |
There are multiple duplicate reports of errors during template rendering due to broken custom templates. Unfortunately the error returned here is somewhat difficult for users to understand and it doesn't return the context of the error. This PR attempts to parse the error returned by the template renderer to add in some further context including the filename of the template AND the preceding lines within that template file. Ref go-gitea#23274 Signed-off-by: Andrew Thornton <art27@cantab.net>
9e854ed
to
3de0cdd
Compare
Could this display the root template name or the template dependency path when encountering a template error? |
Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
I can't report the template dependency path but I've at least added the a message to say if the issue is a subtemplate. |
🎺 🤖 |
There are multiple duplicate reports of errors during template rendering due to broken custom templates. Unfortunately the error returned here is somewhat difficult for users to understand and it doesn't return the context of the error. This PR attempts to parse the error returned by the template renderer to add in some further context including the filename of the template AND the preceding lines within that template file. Ref go-gitea#23274 --------- Signed-off-by: Andrew Thornton <art27@cantab.net>
Backport #23396 by @zeripath There are multiple duplicate reports of errors during template rendering due to broken custom templates. Unfortunately the error returned here is somewhat difficult for users to understand and it doesn't return the context of the error. This PR attempts to parse the error returned by the template renderer to add in some further context including the filename of the template AND the preceding lines within that template file. Ref #23274 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
* upstream/main: Replace a few fontawesome icons with svg (go-gitea#23602) Fix pagination on `/notifications/watching` (go-gitea#23564) Fix `.locale.Tr` function not found in delete modal (go-gitea#23468) fix submodule is nil panic (go-gitea#23588) `Publish Review` buttons should indicate why they are disabled (go-gitea#23598) Improve template error reporting (go-gitea#23396) Polyfill the window.customElements (go-gitea#23592) Add CHANGELOG for 1.19.0 (go-gitea#23583)
There are multiple duplicate reports of errors during template rendering due to broken custom templates.
Unfortunately the error returned here is somewhat difficult for users to understand and it doesn't return the context of the error.
This PR attempts to parse the error returned by the template renderer to add in some further context including the filename of the template AND the preceding lines within that template file.
Ref #23274