瀏覽代碼

Allowing details on encode/decode errors

Evan Huus 12 年之前
父節點
當前提交
fc4945fdf9
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      errors.go

+ 4 - 2
errors.go

@@ -64,15 +64,17 @@ func (err OutOfBrokers) Error() string {
 }
 
 type EncodingError struct {
+	msg string
 }
 
 func (err EncodingError) Error() string {
-	return "kafka: Could not encode packet."
+	return "kafka: Could not encode packet. " + err.msg
 }
 
 type DecodingError struct {
+	msg string
 }
 
 func (err DecodingError) Error() string {
-	return "kafka: Could not decode packet. Is the server really speaking kafka?"
+	return "kafka: Could not decode packet. " + err.msg
 }