MCPcopy Index your code
hub / github.com/google/gvisor / ToError

Method ToError

pkg/syserr/syserr.go:102–117  ·  view source on GitHub ↗

ToError translates an Error to a corresponding error value. TODO(b/34162363): Remove this.

()

Source from the content-addressed store, hash-verified

100//
101// TODO(b/34162363): Remove this.
102func (e *Error) ToError() error {
103 if e == nil {
104 return nil
105 }
106 if e.noTranslation {
107 panic(fmt.Sprintf("error %q does not support translation", e.message))
108 }
109 err := int(e.errno)
110 if err == errno.NOERRNO {
111 return nil
112 }
113 if err >= len(linuxBackwardsTranslations) || !linuxBackwardsTranslations[err].ok {
114 panic(fmt.Sprintf("unknown error %q (%d)", e.message, err))
115 }
116 return linuxBackwardsTranslations[err].err
117}
118
119// ToLinux converts the Error to a Linux ABI error that can be returned to the
120// application.

Callers 15

SocketFunction · 0.80
SocketPairFunction · 0.80
ConnectFunction · 0.80
acceptFunction · 0.80
BindFunction · 0.80
ListenFunction · 0.80
ShutdownFunction · 0.80
GetSockOptFunction · 0.80
SetSockOptFunction · 0.80
GetSockNameFunction · 0.80
GetPeerNameFunction · 0.80
recvSingleMsgFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected