Introduce Sender interface to abstract client sending in router handlers

This commit is contained in:
Mickael Remond
2019-06-14 09:37:38 +02:00
committed by Mickaël Rémond
parent b05e68c844
commit 9db33d5792
4 changed files with 80 additions and 30 deletions

View File

@@ -141,11 +141,11 @@ func (c *Component) recv() (err error) {
// Handle stream errors
switch p := val.(type) {
case StreamError:
c.router.Route(c.conn, val)
c.router.Route(c, val)
c.streamError(p.Error.Local, p.Text)
return errors.New("stream error: " + p.Error.Local)
}
c.router.Route(c.conn, val)
c.router.Route(c, val)
}
}