summaryrefslogtreecommitdiffhomepage
path: root/pkg/syserr/syserr.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/syserr/syserr.go')
-rw-r--r--pkg/syserr/syserr.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/syserr/syserr.go b/pkg/syserr/syserr.go
index 7d0a5125b..765128ff0 100644
--- a/pkg/syserr/syserr.go
+++ b/pkg/syserr/syserr.go
@@ -22,6 +22,7 @@ import (
"golang.org/x/sys/unix"
"gvisor.dev/gvisor/pkg/abi/linux/errno"
+ "gvisor.dev/gvisor/pkg/errors"
"gvisor.dev/gvisor/pkg/errors/linuxerr"
"gvisor.dev/gvisor/pkg/syserror"
)
@@ -281,6 +282,11 @@ func FromError(err error) *Error {
if errno, ok := err.(unix.Errno); ok {
return FromHost(errno)
}
+
+ if linuxErr, ok := err.(*errors.Error); ok {
+ return FromHost(unix.Errno(linuxErr.Errno()))
+ }
+
if errno, ok := syserror.TranslateError(err); ok {
return FromHost(errno)
}