Skip to content
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

Full path to file should be given in EXIF error message #12693

Open
snicolai-blog opened this issue Jul 31, 2024 · 3 comments
Open

Full path to file should be given in EXIF error message #12693

snicolai-blog opened this issue Jul 31, 2024 · 3 comments

Comments

@snicolai-blog
Copy link

$ hugo version
hugo v0.130.0+extended darwin/arm64 BuildDate=2024-07-29T13:51:56Z VendorInfo=brew

I use page objects in my blog, and the new EXIF reader prints error message files relative to the page object. I'd really like it to print them relative to the blog root, so I know which file. For example:

WARN  images: "/fox.jpg": BitsPerSample: expected []interface {}, got uint16:

would be much better as:

WARN  images: "content/posts/part1/part2/fox.jpg": BitsPerSample: expected []interface {}, got uint16:

If it makes sense to strip the content/posts portion off to shorten the error message, that's fine.

@bep
Copy link
Member

bep commented Jul 31, 2024

You are right, but that info isn't easily available where this is printed, which is why I got lazy. The important info for me (to fix this) here is the info to the right.

@nickjj
Copy link

nickjj commented Aug 1, 2024

It would be great if this could also apply to layout errors that are due to a content file being the culprit.

For example, I got this error recently:

Error: error building site: render: failed to render pages: render of "page" failed: "/app/layouts/blog/single.html:3:21": execute of template failed: template: blog/single.html:3:21: executing "main" at <.Fragments.HeadingsMap>: nil pointer evaluating *tableofcontents.Fragments.HeadingsMap

The problem is I have 500 posts and 300 drafts and there's no indication in the error which page is causing it. There's only a reference to a layout file to a function that is being used by those 800 posts.

Similarly I've gotten errors related to a nil reference from a missing image where the error only mentioned the baseof layout file being the issue but it's really due to a missing image in one of the 800 posts. It would be nice to see which content page that image is being referenced from.

@bep bep changed the title Full path to file should be given in error message Full path to file should be given in EXIF error message Aug 1, 2024
@snicolai-blog
Copy link
Author

snicolai-blog commented Aug 1, 2024

Another option is to add "while processing <path to page>" to the error message.

@bep bep modified the milestones: v0.132.0, v0.133.0 Aug 14, 2024
@bep bep modified the milestones: v0.133.0, Unscheduled Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants