commands, hugolib: Get file context in "config parse failed" errors

Fixes #5325
This commit is contained in:
Bjørn Erik Pedersen
2018-10-22 20:20:48 +02:00
parent 2bf686ee21
commit ed7b3e2619
8 changed files with 35 additions and 21 deletions

View File

@@ -662,9 +662,10 @@ func (c *commandeer) fullRebuild() {
c.commandeerHugoState = &commandeerHugoState{}
err := c.loadConfig(true, true)
if err != nil {
c.logger.ERROR.Println("Failed to reload config:", err)
// Set the processing on pause until the state is recovered.
c.paused = true
c.handleBuildErr(err, "Failed to reload config")
} else {
c.paused = false
}