mirror of
https://github.com/moby/buildkit.git
synced 2026-06-30 19:57:39 +00:00
This removes usages of `errors.Cause` in favor of using `errors.As` which is the more standard way of handling error causes. `Cause` was not used frequently and `errors.As` is part of the standard library and is supported by `github.com/pkg/errors`. For one usage of `errors.Cause`, the underlying implementation itself has a reliance on the internal implementation of the error being returned and this method isn't guaranteed to work. Since we are relying on an implementation detail and not an API, I've added a test to ensure the behavior continues working as designed. This also removes a check for an error being returned from containerd that has since been fixed so the code is dead. Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>