Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
osbuild-worker: do not use
error
in clienterror.Error.Details
This is an alternative/complementary fix for PR#4137. It is very simple so should be uncontroverisal. It fixes an issue that @schuellerf discovered, i.e. that when an error interface is passed into clienterrors.Error.Details the details get lost because the json.Marshaler will not know how to handler an error interface. To find the problematic uses of `error` a custom vet checker was build in https://github.com/mvo5/osbuild-cvet. With that the result is: ``` $ go run github.com/mvo5/osbuild-cvet@latest ./... /home/mvogt/devel/osbuild/osbuild-composer/cmd/osbuild-worker/jobimpl-depsolve.go:93:26: do not pass 'error' to WorkerClientError() details, use error.Error() instead /home/mvogt/devel/osbuild/osbuild-composer/cmd/osbuild-worker/jobimpl-osbuild.go:404:31: do not pass 'error' to WorkerClientError() details, use error.Error() instead /home/mvogt/devel/osbuild/osbuild-composer/cmd/osbuild-worker/jobimpl-osbuild.go:519:31: do not pass 'error' to WorkerClientError() details, use error.Error() instead /home/mvogt/devel/osbuild/osbuild-composer/cmd/osbuild-worker/jobimpl-osbuild.go:556:31: do not pass '[]error' to WorkerClientError() details, use []string instead ``` and once this commit is in no more errors. Just like PR#4137 this is not perfect because it will not do a recursive check for the passed argument.
- Loading branch information