From fe8e48fc6d5094fe34783b1040b2ae4ba05349b5 Mon Sep 17 00:00:00 2001 From: Zach Koopmans Date: Thu, 4 Nov 2021 14:52:36 -0700 Subject: [syserr] Move ConvertIntr function to linuxerr package Move ConverIntr out of syserr package and delete an unused function. PiperOrigin-RevId: 407676258 --- pkg/syserr/syserr.go | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'pkg/syserr') 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 -} -- cgit v1.2.3