소스 검색

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
 }