hugolib: Improve error and reload handling of hook templates in server mode

Fixes #6635
This commit is contained in:
Bjørn Erik Pedersen
2019-12-20 08:11:36 +01:00
parent 0453683816
commit 8a58ebb311
8 changed files with 121 additions and 20 deletions

View File

@@ -334,6 +334,7 @@ func (f *fileServer) createEndpoint(i int) (*http.ServeMux, string, string, erro
// First check the error state
err := f.c.getErrorWithContext()
if err != nil {
f.c.wasError = true
w.WriteHeader(500)
r, err := f.errorTemplate(err)
if err != nil {