瀏覽代碼

Handle write error in Do

Fixes #138
Gary Burd 10 年之前
父節點
當前提交
1a6effc8b0
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      redis/conn.go

+ 3 - 1
redis/conn.go

@@ -417,7 +417,9 @@ func (c *conn) Do(cmd string, args ...interface{}) (interface{}, error) {
 	}
 
 	if cmd != "" {
-		c.writeCommand(cmd, args)
+		if err := c.writeCommand(cmd, args); err != nil {
+			return nil, c.fatal(err)
+		}
 	}
 
 	if err := c.bw.Flush(); err != nil {