commands: Show server error info in browser
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 3 Oct 2018 12:58:09 +0000 (14:58 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 16 Oct 2018 20:10:56 +0000 (22:10 +0200)
commit35fbfb19a173b01bc881f2bbc5d104136633a7ec
tree636d0d51fa262dc808eb3c5cc9cf92ad977a0c6a
parent3a3089121b852332b5744d1f566959c8cf93cef4
commands: Show server error info in browser

The main item in this commit is showing of errors with a file context when running `hugo server`.

This can be turned off: `hugo server --disableBrowserError` (can also be set in `config.toml`).

But to get there, the error handling in Hugo needed a revision. There are some items left TODO for commits soon to follow, most notable errors in content and config files.

Fixes #5284
Fixes #5290
See #5325
See #5324
74 files changed:
commands/commandeer.go
commands/commands.go
commands/convert.go
commands/hugo.go
commands/new_site.go
commands/server.go
commands/server_errors.go [new file with mode: 0644]
commands/server_test.go
commands/static_syncer.go
commands/version.go
common/errors/errors.go [deleted file]
common/herrors/error_locator.go [new file with mode: 0644]
common/herrors/error_locator_test.go [new file with mode: 0644]
common/herrors/errors.go [new file with mode: 0644]
common/herrors/file_error.go [new file with mode: 0644]
common/herrors/file_error_test.go [new file with mode: 0644]
common/herrors/line_number_extractors.go [new file with mode: 0644]
common/loggers/loggers.go
create/content.go
create/content_template_handler.go
deps/deps.go
go.mod
go.sum
helpers/path.go
hugolib/alias.go
hugolib/config.go
hugolib/datafiles_test.go
hugolib/fileInfo.go
hugolib/hugo_sites.go
hugolib/hugo_sites_build.go
hugolib/hugo_sites_build_errors_test.go [new file with mode: 0644]
hugolib/hugo_sites_build_failures_test.go [deleted file]
hugolib/page.go
hugolib/page_bundler.go
hugolib/page_bundler_capture.go
hugolib/page_bundler_capture_test.go
hugolib/page_bundler_test.go
hugolib/page_test.go
hugolib/pagemeta/page_frontmatter.go
hugolib/paths/paths.go
hugolib/shortcode.go
hugolib/shortcode_test.go
hugolib/site.go
hugolib/site_render.go
hugolib/site_test.go
hugolib/testhelpers_test.go
i18n/i18n.go
i18n/i18n_test.go
i18n/translationProvider.go
releaser/releaser.go
resource/image.go
resource/postcss/postcss.go
resource/resource.go
resource/resource_metadata.go
resource/templates/execute_as_template.go
resource/tocss/scss/tocss.go
resource/tocss/scss/tocss_notavailable.go
resource/transform.go
tpl/collections/collections_test.go
tpl/data/data.go
tpl/data/data_test.go
tpl/fmt/fmt.go
tpl/fmt/init.go
tpl/fmt/init_test.go
tpl/partials/init_test.go
tpl/resources/resources.go
tpl/strings/strings.go
tpl/template.go
tpl/template_test.go [new file with mode: 0644]
tpl/tplimpl/template.go
tpl/tplimpl/templateProvider.go
tpl/tplimpl/template_errors.go [new file with mode: 0644]
tpl/tplimpl/template_funcs_test.go
tpl/urls/urls.go