mirror of
https://github.com/jech/galene.git
synced 2024-11-22 08:35:57 +01:00
Implement client.error.
This commit is contained in:
parent
b053a64631
commit
e0eee9e7e2
1 changed files with 12 additions and 0 deletions
12
group.go
12
group.go
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue