Commit e0eee9e7 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Implement client.error.

parent b053a646
......@@ -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 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment