Update error name to ErrClientNotFound

This commit is contained in:
Milos Gajdos 2019-09-05 17:43:59 +01:00
parent 5ddfd911ba
commit b01c8e06e0
No known key found for this signature in database
GPG Key ID: 8B31058CC55DFD4F

View File

@ -29,8 +29,8 @@ var (
DefaultLink = "network" DefaultLink = "network"
// ErrMsgUnknown is returned when unknown message is attempted to send or receive // ErrMsgUnknown is returned when unknown message is attempted to send or receive
ErrMsgUnknown = errors.New("unknown message") ErrMsgUnknown = errors.New("unknown message")
// ErrChannelUnknown is returned when attempting to send or received on unknown channel // ErrClientNotFound is returned when client for tunnel channel could not be found
ErrChannelUnknown = errors.New("unknown channel") ErrClientNotFound = errors.New("client not found")
) )
// node is network node // node is network node
@ -462,7 +462,7 @@ func (n *network) sendMsg(msgType string, channel string) error {
client, ok := n.tunClient[channel] client, ok := n.tunClient[channel]
if !ok { if !ok {
n.RUnlock() n.RUnlock()
return ErrChannelUnknown return ErrClientNotFound
} }
n.RUnlock() n.RUnlock()