1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-26 19:21:03 +03:00

parser: Introduce parserError.

This commit is contained in:
Vladimir Mihailenco
2012-08-26 12:18:42 +03:00
parent 037888ee0f
commit a94daf0c96
3 changed files with 185 additions and 145 deletions

View File

@ -119,14 +119,14 @@ func (c *BaseClient) Run(req Req) {
val, err := req.ParseReply(conn.Rd)
if err != nil {
if err == Nil {
if err := c.ConnPool.Add(conn); err != nil {
Logger.Printf("ConnPool.Add error: %v", err)
}
} else {
if _, ok := err.(*parserError); ok {
if err := c.ConnPool.Remove(conn); err != nil {
Logger.Printf("ConnPool.Remove error: %v", err)
}
} else {
if err := c.ConnPool.Add(conn); err != nil {
Logger.Printf("ConnPool.Add error: %v", err)
}
}
req.SetErr(err)
return