system: wrap op errors
Some checks failed
Test / Create distribution (push) Successful in 34s
Test / Hakurei (push) Failing after 1m5s
Test / Sandbox (push) Failing after 1m28s
Test / Hpkg (push) Failing after 1m53s
Test / Hakurei (race detector) (push) Failing after 2m8s
Test / Sandbox (race detector) (push) Failing after 3m33s
Test / Flake checks (push) Has been skipped
Some checks failed
Test / Create distribution (push) Successful in 34s
Test / Hakurei (push) Failing after 1m5s
Test / Sandbox (push) Failing after 1m28s
Test / Hpkg (push) Failing after 1m53s
Test / Hakurei (race detector) (push) Failing after 2m8s
Test / Sandbox (race detector) (push) Failing after 3m33s
Test / Flake checks (push) Has been skipped
This passes more information allowing for better error handling. This eliminates generic WrapErr from system. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -33,8 +33,10 @@ func (e *OpError) Error() string {
|
||||
}
|
||||
|
||||
switch {
|
||||
case errors.As(e.Err, new(*os.PathError)), errors.As(e.Err, new(*net.OpError)):
|
||||
return e.Err.Error()
|
||||
case errors.As(e.Err, new(*os.PathError)),
|
||||
errors.As(e.Err, new(*net.OpError)),
|
||||
errors.As(e.Err, new(*container.StartError)):
|
||||
return "cannot " + e.Err.Error()
|
||||
|
||||
default:
|
||||
if !e.Revert {
|
||||
|
||||
Reference in New Issue
Block a user