device: introduce new IPC error message for unknown error
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
This commit is contained in:
parent
87bdcb2ae4
commit
674a4675a1
@ -427,8 +427,8 @@ func (device *Device) IpcHandle(socket net.Conn) {
|
|||||||
// write status
|
// write status
|
||||||
var status *IPCError
|
var status *IPCError
|
||||||
if err != nil && !errors.As(err, &status) {
|
if err != nil && !errors.As(err, &status) {
|
||||||
// I/O error, maybe something unexpected
|
// shouldn't happen
|
||||||
status = ipcErrorf(1, "other UAPI error: %w", err)
|
status = ipcErrorf(ipc.IpcErrorUnknown, "other UAPI error: %w", err)
|
||||||
}
|
}
|
||||||
if status != nil {
|
if status != nil {
|
||||||
device.log.Error.Println(status)
|
device.log.Error.Println(status)
|
||||||
|
@ -21,6 +21,7 @@ const (
|
|||||||
IpcErrorProtocol = -int64(unix.EPROTO)
|
IpcErrorProtocol = -int64(unix.EPROTO)
|
||||||
IpcErrorInvalid = -int64(unix.EINVAL)
|
IpcErrorInvalid = -int64(unix.EINVAL)
|
||||||
IpcErrorPortInUse = -int64(unix.EADDRINUSE)
|
IpcErrorPortInUse = -int64(unix.EADDRINUSE)
|
||||||
|
IpcErrorUnknown = -55 // ENOANO
|
||||||
)
|
)
|
||||||
|
|
||||||
// socketDirectory is variable because it is modified by a linker
|
// socketDirectory is variable because it is modified by a linker
|
||||||
|
Loading…
Reference in New Issue
Block a user