From 20bebc13a5d2c14266cc80d2bac646475ca4b5e8 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Sat, 11 May 2013 02:29:11 -0500 Subject: [PATCH] Convert WriteMessage errors to MessgeError type. --- message.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/message.go b/message.go index 13d0d77a..f1ee1f4f 100644 --- a/message.go +++ b/message.go @@ -160,8 +160,9 @@ func WriteMessage(w io.Writer, msg Message, pver uint32, btcnet BitcoinNet) erro cmd := msg.Command() if len(cmd) > commandSize { - str := "WriteMessage: command is too long [%s]" - return fmt.Errorf(str, command) + str := fmt.Sprintf("command [%s] is too long [max %v]", + cmd, commandSize) + return messageError("WriteMessage", str) } copy(command[:], []byte(cmd))