-
Notifications
You must be signed in to change notification settings - Fork 320
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
Unify error messages and prepare to adopt wrapping error messages, part 1 #518
Conversation
This needs a DCO sign-off. You can use |
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.6.0 to 0.7.0. - [Release notes](https://github.com/golang/sys/releases) - [Commits](golang/sys@v0.6.0...v0.7.0) --- updated-dependencies: - dependency-name: golang.org/x/sys dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: conall <conall@conall.net>
and MountError Signed-off-by: conall <conall@conall.net>
…riables - Include original err whenever raising an exception Signed-off-by: conall <conall@conall.net>
issue was found by Svace static analyzer (https://www.ispras.ru/en/technologies/svace/) Signed-off-by: Artem Seleznev <seleznyov.artyom@gmail.com> Signed-off-by: conall <conall@conall.net>
Can be used by other projects (eg node_exporter) to read a single sysfs file rather than all of them at once, which can cause lock contention in the kernel as many sysfs net files grab the RTNL lock. Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: conall <conall@conall.net>
Modernised method of fetching mdraid statistics via machine-readable sysfs entries, instead of parsing human-readable /proc/mdstat. Signed-off-by: Daniel Swarbrick <daniel.swarbrick@gmail.com> Signed-off-by: conall <conall@conall.net>
Signed-off-by: shankeerthan-kasilingam <shankeerthan1995@gmail.com> Signed-off-by: conall <conall@conall.net>
Signed-off-by: conall <conall@conall.net>
… and cpuinfo.go Signed-off-by: conall <conall@conall.net>
fscache.go Signed-off-by: conall <conall@conall.net>
Signed-off-by: conall <conall@conall.net>
Signed-off-by: conall <conall@conall.net>
Move the file hadling into the parseNetstat() function to only open one file at a time. This eliminates keeping all files open until all are read. Signed-off-by: SuperQ <superq@gmail.com> Signed-off-by: conall <conall@conall.net>
mountstats.go Signed-off-by: conall <conall@conall.net>
Signed-off-by: conall <conall@conall.net>
Signed-off-by: conall <conall@conall.net>
Signed-off-by: conall <conall@conall.net>
and net_ip_socket.go Signed-off-by: conall <conall@conall.net>
fmt.Errorf() atoms when there is no err to wrap Signed-off-by: conall <conall@conall.net>
Signed-off-by: conall <conall@conall.net>
Signed-off-by: conall <conall@conall.net>
Signed-off-by: conall <conall@conall.net>
Signed-off-by: conall <conall@conall.net>
Signed-off-by: conall <conall@conall.net>
fmt.Errorf() is only available in Go v1.20+ https://go.dev/doc/go1.20#errors Signed-off-by: conall <conall@conall.net>
Signed-off-by: conall <conall@conall.net>
Done. I've also filed #519 to track replacing these |
Co-authored-by: Ben Kochie <superq@gmail.com> Signed-off-by: Conall O'Brien <conall@conall.net>
Opened #520 to try and fix up golangci-lint |
Signed-off-by: Conall O'Brien <conall@conall.net>
Signed-off-by: Conall O'Brien <conall@conall.net>
…errors Signed-off-by: Conall O'Brien <conall@conall.net>
#522 was intended to be a complimentary PR, but I managed to goof the git branches, so all changes are now in this PR PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are still a lot of errors that drop the original context of what part of parsing failed. Please make sure that we keep the original details of the parsing error intact.
I've highlighted a number of them.
Thanks, I have been fixing up entries that didn't give specifics, but I may have missed a few early on |
Fixed up all the vague, non specific errors ( I do have 2 commits which aren't DCO signed (should work out how to config that per repository) and I'm not sure how to amend those commits |
* Update Go to 1.20. * Update minimum Go to 1.19. * Update Go modules. * Fix deprecated os/ioutil use. Signed-off-by: Ben Kochie <superq@gmail.com>
* add CpusAllowedList for /proc/[pid]/status Signed-off-by: mn.albeschenko <albeschenko.work@gmail.com> * Fix documentation comment Co-authored-by: Ben Kochie <superq@gmail.com> Signed-off-by: Johannes 'fish' Ziemke <github@5pi.de> --------- Signed-off-by: mn.albeschenko <albeschenko.work@gmail.com> Signed-off-by: Johannes 'fish' Ziemke <github@5pi.de> Co-authored-by: Johannes 'fish' Ziemke <github@5pi.de> Co-authored-by: Ben Kochie <superq@gmail.com>
#483 introduced a bug that terminates attribute reading when the returned error is syscall.Errno, which is what util.SysReadFile() will typically return. Handle that case specifically. While doing that pull the error checking into ParseNetClassAttribute() for clarity and to allow external callers to handle errors correctly. Signed-off-by: Dan Williams <dcbw@redhat.com>
…ment Signed-off-by: Conall O'Brien <conall@conall.net>
This reverts commit 5a7050c. Signed-off-by: Conall O'Brien <conall@conall.net>
…is (#523) Other projects that import procfs, like node_exporter, apparently build for OSs that don't have Statfs_t.Type. Signed-off-by: Dan Williams <dcbw@redhat.com>
When parsing older kernel versoins, we assume the CPU is indexed based on the parsed line, rather than an explicit index column. Signed-off-by: Ben Kochie <superq@gmail.com>
Recreated as #526 , but without all the messed up git history |
Unify error messages by using the errors module. Prepare for wrapping errors once Go v1.20 is the default.
This is part 1 of an implementation for #358