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

resources: Replace error handling in GetRemote with try (note) #13217

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

bep
Copy link
Member

@bep bep commented Jan 5, 2025

Some things I need to think about re. this:

  • The .Err you get in try is a composite error with file paths etc. I have added .Cause to get the underlying error, so it's possible to get the .Data attribute that's set on the ResourceError ... This is a little clumsy, but so be it. Possilby better to do .Err.Cause, not sure.
  • For errors that's not handled with try we add file/position information, that would also be nice ... but sounds tricky.

I have added .Cause to the error, the second bullet above needs to wait.

Closes #13216

@bep bep force-pushed the err-getremote-13216 branch 10 times, most recently from f128ded to 6fbf0cf Compare January 6, 2025 08:41
@bep bep force-pushed the err-getremote-13216 branch from 6fbf0cf to 49d8a15 Compare January 6, 2025 09:40
@bep bep marked this pull request as ready for review January 6, 2025 11:22
@bep bep merged commit 0918e08 into gohugoio:master Jan 6, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace error handling in GetRemote with try
2 participants