Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lazy
diff options
context:
space:
mode:
authorMichael Lynch <git@mtlynch.io>2020-04-27 00:13:25 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-04-27 14:23:35 +0300
commitfe60b7d9e4c12dbc428f992c05969bc14c7fe7a2 (patch)
tree138ba93a606b57c3376678f3fa01431c534907da /lazy
parentc2d9fd1ebef89cc19256e6799f29ab3d27eaf879 (diff)
Add diagnostic hints to init timeout message
Expand the text in the init timeout message to give the reader more hints as to what may be causing the issue. The current error sent me on a wild goose chase trying to debug my shortcodes, but it turned out that the issue was just that I wasn't caching my resources/ directory on my build server. Once I found this blog post, I solved the issue in minutes: https://www.henriksommerfeld.se/hugo-timeout-not-a-circular-loop-in-shortcode/ Googling the error message yields several additional posts from users who focus on loops in their shortcode when the problem seems to be overly-expensive builds.
Diffstat (limited to 'lazy')
-rw-r--r--lazy/init.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/lazy/init.go b/lazy/init.go
index 2fef027cf..7f6c5b08c 100644
--- a/lazy/init.go
+++ b/lazy/init.go
@@ -185,7 +185,7 @@ func (ini *Init) withTimeout(timeout time.Duration, f func(ctx context.Context)
select {
case <-ctx.Done():
- return nil, errors.New("timed out initializing value. This is most likely a circular loop in a shortcode")
+ return nil, errors.New("timed out initializing value. You may have a circular loop in a shortcode, or your site may have resources that take longer to build than the `timeout` limit in your Hugo config file.")
case ve := <-c:
return ve.v, ve.err
}