From 9832545d84aa5b78bf7a059cb37013a2777da94c Mon Sep 17 00:00:00 2001 From: Jeromy Date: Sat, 7 Mar 2015 19:08:39 -0800 Subject: [PATCH] better error message from dagreader with bad protofbuf --- unixfs/io/dagreader.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unixfs/io/dagreader.go b/unixfs/io/dagreader.go index 0af49e9ee..64dfff127 100644 --- a/unixfs/io/dagreader.go +++ b/unixfs/io/dagreader.go @@ -3,6 +3,7 @@ package io import ( "bytes" "errors" + "fmt" "io" "os" @@ -113,7 +114,7 @@ func (dr *DagReader) precalcNextBuf() error { pb := new(ftpb.Data) err = proto.Unmarshal(nxt.Data, pb) if err != nil { - return err + return fmt.Errorf("incorrectly formatted protobuf: %s", err) } switch pb.GetType() {