Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/develop 7b802ae47 -> 80a676e13


newtmgr - Indicate hex dump of undecodable rsps.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/80a676e1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/80a676e1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/80a676e1

Branch: refs/heads/develop
Commit: 80a676e13c34fb04be7e4e31bea2af14592161cf
Parents: 7b802ae
Author: Christopher Collins <ccoll...@apache.org>
Authored: Wed Oct 12 14:07:31 2016 -0700
Committer: Christopher Collins <ccoll...@apache.org>
Committed: Wed Oct 12 14:07:51 2016 -0700

----------------------------------------------------------------------
 newtmgr/transport/connserial.go | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/80a676e1/newtmgr/transport/connserial.go
----------------------------------------------------------------------
diff --git a/newtmgr/transport/connserial.go b/newtmgr/transport/connserial.go
index c16c8f1..11ceadc 100644
--- a/newtmgr/transport/connserial.go
+++ b/newtmgr/transport/connserial.go
@@ -23,6 +23,7 @@ import (
        "bufio"
        "encoding/base64"
        "encoding/binary"
+       "encoding/hex"
        "fmt"
        "time"
 
@@ -87,8 +88,9 @@ func (cs *ConnSerial) ReadPacket() (*Packet, error) {
                data, err := base64.StdEncoding.DecodeString(base64Data)
                if err != nil {
                        return nil, util.NewNewtError(
-                               fmt.Sprintf("Couldn't decode base64 string: %b",
-                                       base64Data))
+                               fmt.Sprintf("Couldn't decode base64 string: 
%s\n"+
+                                       "Packet hex dump:\n%s",
+                                       base64Data, hex.Dump(line)))
                }
 
                if line[0] == 6 && line[1] == 9 {

Reply via email to