summaryrefslogtreecommitdiffhomepage
path: root/pkg/syserr
diff options
context:
space:
mode:
authorZach Koopmans <zkoopmans@google.com>2021-11-04 14:52:36 -0700
committergVisor bot <gvisor-bot@google.com>2021-11-04 14:55:52 -0700
commitfe8e48fc6d5094fe34783b1040b2ae4ba05349b5 (patch)
tree3d532abd71a834b5bfc3af57b34db1609c8d028c /pkg/syserr
parent23a115dae84e7e63c8785c49dfff3e551a0bf97e (diff)
[syserr] Move ConvertIntr function to linuxerr package
Move ConverIntr out of syserr package and delete an unused function. PiperOrigin-RevId: 407676258
Diffstat (limited to 'pkg/syserr')
-rw-r--r--pkg/syserr/syserr.go18
1 files changed, 0 insertions, 18 deletions
diff --git a/pkg/syserr/syserr.go b/pkg/syserr/syserr.go
index b679f3046..17d0b3e1a 100644
--- a/pkg/syserr/syserr.go
+++ b/pkg/syserr/syserr.go
@@ -74,15 +74,6 @@ func NewDynamic(message string, linuxTranslation errno.Errno) *Error {
return &Error{message: message, errno: linuxTranslation}
}
-// NewWithoutTranslation creates a new Error. If translation is attempted on
-// the error, translation will fail.
-//
-// NewWithoutTranslation may be called at any time, but static errors should
-// be declared as global variables and dynamic errors should be used sparingly.
-func NewWithoutTranslation(message string) *Error {
- return &Error{message: message, noTranslation: true}
-}
-
func newWithHost(message string, linuxTranslation errno.Errno, hostErrno unix.Errno) *Error {
e := New(message, linuxTranslation)
addLinuxHostTranslation(hostErrno, e)
@@ -292,12 +283,3 @@ func FromError(err error) *Error {
msg := fmt.Sprintf("err: %s type: %T", err.Error(), err)
panic(msg)
}
-
-// ConvertIntr converts the provided error code (err) to another one (intr) if
-// the first error corresponds to an interrupted operation.
-func ConvertIntr(err, intr error) error {
- if err == linuxerr.ErrInterrupted {
- return intr
- }
- return err
-}