1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-09 18:25:58 +01:00

Implement client.error.

This commit is contained in:
Juliusz Chroboczek 2020-04-25 17:30:19 +02:00
parent b053a64631
commit e0eee9e7e2

View file

@ -261,6 +261,18 @@ func (c *client) write(m clientMessage) error {
}
}
func (c *client) error(err error) error {
switch e := err.(type) {
case userError:
return c.write(clientMessage{
Type: "error",
Message: "The server said: " + string(e),
})
default:
return err
}
}
type clientDeadError int
func (err clientDeadError) Error() string {