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:
@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user