Skip to content

Commit

Permalink
error log
Browse files Browse the repository at this point in the history
  • Loading branch information
huangnauh committed Nov 7, 2024
1 parent 901143e commit 38d6b20
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion partial/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"errors"
"io"
"log"
"os"
"sync"
)
Expand Down Expand Up @@ -116,6 +117,7 @@ func (p *MultiPartialDownloader) Download() error {
chunksSorter.Write(chunk)

if err != nil {
log.Printf("part %d, error: %s", chunk.index, err)
return
}
}
Expand All @@ -135,7 +137,11 @@ func (p *MultiPartialDownloader) Download() error {
if len(chunk.Data()) == 0 {
return errors.New("chunk buffer download but size is 0")
}
p.writer.Write(chunk.Data())
_, err := p.writer.Write(chunk.Data())
if err != nil {
log.Printf("part %d, error: %s", chunk.index, err)
return err
}
}
return nil
}

0 comments on commit 38d6b20

Please sign in to comment.