-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect frontmatter termination should produce better error message #4472
Comments
@bep I've spent many hours trying to trace template and front matter errors from messages with less info than this one. This is a general source of pain. See #2609, #3171, #4041, #3957, #3514, #1736, #947, #2295 and many others. It's far more painful for people who are not intimate with the Hugo code or nuances in its behavior, so pros like you probably don't feel the pain. During those many hours above I've inserted some ad-hoc error message details in my dev fork, and I remember coming across this (and your comment within it): Lines 1768 to 1780 in e7fda28
In my dev for I've changed line 1774 to add context (
But rather than adding more ad-hoc details to error messages throughout the codebase, why not introduce a richer set of Error structures, and change method signatures to use those rather than the plain built-in Thoughts? |
Sure, but I1m not sure why you need to change the method signature. I think something ala |
@bep I was just going to replace my comment with a link to a forum post: https://discourse.gohugo.io/t/more-user-friendly-error-reporting/10852. Continue there? |
Sure. |
I've just been through this as a new Hugo user. To see the effect, take a random content file in your Hugo site, and remove the closing Using the |
This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help. |
This is now fixed. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Fatal errors caused by incorrect Frontmatter termination result in a mostly useless error message. The message should include the filename so user knows what to troubleshoot.
To reproduce, simply create a content file with (for example) YAML frontmatter block that terminates with
...
instead of---
(which one might assume is right if they are familiar with YAML but not with Hugo!)The text was updated successfully, but these errors were encountered: