forgejo/modules
Giteabot a3b917151c
Improve template error reporting (#23396) (#23600)
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>
2023-03-20 17:53:45 -04:00
..
actions Convert GitHub event on actions and fix some pull_request events. (#23037) (#23471) 2023-03-15 10:43:10 +08:00
activitypub Add Chef package registry (#22554) 2023-02-06 09:49:21 +08:00
analyze Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
auth Fix various bugs for "install" page (#23194) (#23286) 2023-03-05 11:59:58 +01:00
avatar Unify hashing for avatar (#22289) 2023-01-02 22:46:39 +01:00
base Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
cache Add context cache as a request level cache (#22294) 2023-02-15 21:37:34 +08:00
charset Fix isAllowed of escapeStreamer (#22814) 2023-02-09 20:51:36 +08:00
container Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
context Improve template error reporting (#23396) (#23600) 2023-03-20 17:53:45 -04:00
csv Add context when rendering labels or emojis (#23281) (#23319) 2023-03-06 10:32:40 -06:00
doctor Refactor setting.Database.UseXXX to methods (#23354) (#23356) 2023-03-07 20:11:44 +08:00
emoji Fix unstable emoji sort (#22346) 2023-01-05 13:58:51 +02:00
eventsource Move convert package to services (#22264) 2022-12-29 10:57:15 +08:00
generate Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
git Refactor merge/update git command calls (#23366) (#23544) 2023-03-17 12:16:22 -04:00
gitgraph Add context cache as a request level cache (#22294) 2023-02-15 21:37:34 +08:00
graceful Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
hcaptcha Consume hcaptcha and pwn deps (#22610) 2023-01-29 09:49:51 -06:00
highlight Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
hostmatcher Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
html Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
httpcache Set X-Gitea-Debug header once (#23361) (#23381) 2023-03-09 06:33:05 +08:00
httplib Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
indexer Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
issue/template Allow issue templates to not render title (#22589) 2023-01-26 22:45:49 -06:00
json Update gitea-vet to check FSFE REUSE (#22004) 2022-12-02 22:14:57 +08:00
label Add loading yaml label template files (#22976) (#23232) 2023-03-01 21:57:34 -05:00
lfs escape filename when assemble URL (#22850) 2023-02-12 09:31:14 +08:00
log Improve trace logging for pulls and processes (#22633) 2023-02-03 18:11:48 -05:00
markup Add context when rendering labels or emojis (#23281) (#23319) 2023-03-06 10:32:40 -06:00
mcaptcha Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
metrics include build info in Prometheus metrics (#22819) 2023-02-08 19:54:01 +02:00
migration Scoped labels (#22585) 2023-02-18 21:17:39 +02:00
mirror Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
nosql Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
notification Implement actions (#21937) 2023-01-31 09:45:19 +08:00
options Add loading yaml label template files (#22976) (#23232) 2023-03-01 21:57:34 -05:00
packages Use import of OCI structs (#22765) 2023-02-06 10:07:09 +00:00
paginator Update gitea-vet to check FSFE REUSE (#22004) 2022-12-02 22:14:57 +08:00
pprof Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
private Implement actions (#21937) 2023-01-31 09:45:19 +08:00
process Improve trace logging for pulls and processes (#22633) 2023-02-03 18:11:48 -05:00
proxy Use proxy for pull mirror (#22771) 2023-02-11 08:39:50 +08:00
proxyprotocol Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
public Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
queue Properly flush unique queues on startup (#23154) (#23201) 2023-03-06 22:35:07 +08:00
recaptcha Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
references Use correct captured group range when parsing cross-reference (#22672) 2023-01-31 10:08:05 +01:00
regexplru Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
repository Add loading yaml label template files (#22976) (#23232) 2023-03-01 21:57:34 -05:00
secret Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
session Update gitea-vet to check FSFE REUSE (#22004) 2022-12-02 22:14:57 +08:00
setting Add .patch to attachment.ALLOWED_TYPES (#23580) (#23582) 2023-03-19 16:48:44 -04:00
sitemap Fix sitemap (#22272) 2022-12-30 23:31:00 +08:00
ssh Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
storage Add InsecureSkipVerify to Minio Client for Storage (#23166) (#23177) 2023-02-28 00:29:17 +02:00
structs Add scopes to API to create token and display them (#22989) 2023-02-20 15:28:44 -06:00
svg Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
sync Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
system Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
templates Improve template error reporting (#23396) (#23600) 2023-03-20 17:53:45 -04:00
test Rename repo.GetOwner to repo.LoadOwner (#22967) 2023-02-18 20:11:03 +08:00
timeutil Make time tooltips interactive (#23526) (#23527) 2023-03-16 16:23:11 -05:00
translation Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
turnstile Add new captcha: cloudflare turnstile (#22369) 2023-02-05 15:29:03 +08:00
typesniffer Do not recognize text files as audio (#23355) (#23368) 2023-03-08 16:03:05 +08:00
updatechecker Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
upload Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
uri Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
user Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
util Move IsReadmeFile* from modules/markup/ to modules/util (#22877) 2023-02-13 15:01:09 -05:00
validation Map OIDC groups to Orgs/Teams (#21441) 2023-02-08 14:44:42 +08:00
watcher Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
web Map OIDC groups to Orgs/Teams (#21441) 2023-02-08 14:44:42 +08:00
webhook Restructure webhook module (#22256) 2023-01-01 23:23:15 +08:00