diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-10-13 13:53:34 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-10-13 13:53:34 -0700 |
| commit | aac4cb1f0ccead575c92f9df44820b16b487051b (patch) | |
| tree | 07752f638c8bc533d855db99f243a4c869937ab9 | |
| parent | 9b4f7fed14aa23115b896cc19c909b6c8f8db336 (diff) | |
| download | seaweedfs-aac4cb1f0ccead575c92f9df44820b16b487051b.tar.xz seaweedfs-aac4cb1f0ccead575c92f9df44820b16b487051b.zip | |
adds errror on read and write
| -rw-r--r-- | weed/filer/stream.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/weed/filer/stream.go b/weed/filer/stream.go index 1e1d5c7f3..363b07f14 100644 --- a/weed/filer/stream.go +++ b/weed/filer/stream.go @@ -2,6 +2,7 @@ package filer import ( "bytes" + "fmt" "io" "math" "strings" @@ -35,10 +36,14 @@ func StreamContent(masterClient *wdclient.MasterClient, w io.Writer, chunks []*f data, err := retriedFetchChunkData(urlStrings, chunkView.CipherKey, chunkView.IsGzipped, chunkView.IsFullChunk(), chunkView.Offset, int(chunkView.Size)) if err != nil { - return err + glog.Errorf("read chunk: %v", err) + return fmt.Errorf("read chunk: %v", err) + } + _, err = w.Write(data) + if err != nil { + glog.Errorf("write chunk: %v", err) + return fmt.Errorf("write chunk: %v", err) } - w.Write(data) - } return nil |
