1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-10-25 10:27:01 +08:00

better error message from dagreader with bad protofbuf

This commit is contained in:
Jeromy
2015-03-07 19:08:39 -08:00
parent 63e15abd8f
commit 9832545d84

View File

@ -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() {