MCPcopy
hub / github.com/google/gvisor / TranslateNetstackError

Function TranslateNetstackError

pkg/syserr/netstack.go:63–158  ·  view source on GitHub ↗

TranslateNetstackError converts an error from the tcpip package to a sentry internal error.

(err tcpip.Error)

Source from the content-addressed store, hash-verified

61// TranslateNetstackError converts an error from the tcpip package to a sentry
62// internal error.
63func TranslateNetstackError(err tcpip.Error) *Error {
64 switch err.(type) {
65 case nil:
66 return nil
67 case *tcpip.ErrUnknownProtocol:
68 return ErrUnknownProtocol
69 case *tcpip.ErrUnknownNICID:
70 return ErrUnknownNICID
71 case *tcpip.ErrUnknownDevice:
72 return ErrUnknownDevice
73 case *tcpip.ErrUnknownProtocolOption:
74 return ErrUnknownProtocolOption
75 case *tcpip.ErrDuplicateNICID:
76 return ErrDuplicateNICID
77 case *tcpip.ErrDuplicateAddress:
78 return ErrDuplicateAddress
79 case *tcpip.ErrHostUnreachable:
80 return ErrHostUnreachable
81 case *tcpip.ErrHostDown:
82 return ErrHostDown
83 case *tcpip.ErrNoNet:
84 return ErrNoNet
85 case *tcpip.ErrAlreadyBound:
86 return ErrAlreadyBound
87 case *tcpip.ErrInvalidEndpointState:
88 return ErrInvalidEndpointState
89 case *tcpip.ErrAlreadyConnecting:
90 return ErrAlreadyConnecting
91 case *tcpip.ErrAlreadyConnected:
92 return ErrAlreadyConnected
93 case *tcpip.ErrNoPortAvailable:
94 return ErrNoPortAvailable
95 case *tcpip.ErrPortInUse:
96 return ErrPortInUse
97 case *tcpip.ErrBadLocalAddress:
98 return ErrBadLocalAddress
99 case *tcpip.ErrClosedForSend:
100 return ErrClosedForSend
101 case *tcpip.ErrClosedForReceive:
102 return ErrClosedForReceive
103 case *tcpip.ErrWouldBlock:
104 return ErrWouldBlock
105 case *tcpip.ErrConnectionRefused:
106 return ErrConnectionRefused
107 case *tcpip.ErrTimeout:
108 return ErrTimeout
109 case *tcpip.ErrAborted:
110 return ErrAborted
111 case *tcpip.ErrConnectStarted:
112 return ErrConnectStarted
113 case *tcpip.ErrDestinationRequired:
114 return ErrDestinationRequired
115 case *tcpip.ErrNotSupported:
116 return ErrNotSupported
117 case *tcpip.ErrQueueSizeNotSupported:
118 return ErrQueueSizeNotSupported
119 case *tcpip.ErrNotConnected:
120 return ErrNotConnected

Callers 15

sockErrCmsgToLinuxFunction · 0.92
GetPeerNameMethod · 0.92
GetSockNameMethod · 0.92
RecvMsgMethod · 0.92
AcceptMethod · 0.92
SocketMethod · 0.92
packetSocketFunction · 0.92
RemoveInterfaceMethod · 0.92
setLinkLockedMethod · 0.92
newVethMethod · 0.92
newBridgeMethod · 0.92
AddInterfaceAddrMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…