diff --git a/system/output.go b/system/output.go index e602976..f183ebf 100644 --- a/system/output.go +++ b/system/output.go @@ -34,6 +34,7 @@ func (e *OpError) Error() string { switch { case errors.As(e.Err, new(*os.PathError)), + errors.As(e.Err, new(*os.LinkError)), errors.As(e.Err, new(*net.OpError)), errors.As(e.Err, new(*container.StartError)): return e.Err.Error() diff --git a/system/output_test.go b/system/output_test.go index 2dfa337..b091f5e 100644 --- a/system/output_test.go +++ b/system/output_test.go @@ -137,22 +137,14 @@ func TestPrintJoinedError(t *testing.T) { {"file descriptor in bad state"}, }}, {"many message", errors.Join( - &container.StartError{ - Step: "meow", - Err: syscall.ENOMEM, - }, - &os.PathError{ - Op: "meow", - Path: "/proc/nonexistent", - Err: syscall.ENOSYS, - }, - &OpError{ - Op: "meow", - Err: syscall.ENODEV, - Revert: true, - }), [][]any{ + &container.StartError{Step: "meow", Err: syscall.ENOMEM}, + &os.PathError{Op: "meow", Path: "/proc/nonexistent", Err: syscall.ENOSYS}, + &os.LinkError{Op: "link", Old: "/etc", New: "/proc/nonexistent", Err: syscall.ENOENT}, + &OpError{Op: "meow", Err: syscall.ENODEV, Revert: true}, + ), [][]any{ {"cannot meow: cannot allocate memory"}, {"meow /proc/nonexistent: function not implemented"}, + {"link /etc /proc/nonexistent: no such file or directory"}, {"cannot revert meow: no such device"}, }}, }