When a chunk can't be found, print the error if it is not nil

This commit is contained in:
Gilbert Chen
2017-08-01 23:08:11 -04:00
parent db3e0946bb
commit fa294eabf4

View File

@@ -314,7 +314,11 @@ func (downloader *ChunkDownloader) Download(threadIndex int, task ChunkDownloadT
if !exist {
// A chunk is not found. This is a serious error and hopefully it will never happen.
LOG_FATAL("DOWNLOAD_CHUNK", "Chunk %s can't be found", chunkID)
if err != nil {
LOG_FATAL("DOWNLOAD_CHUNK", "Chunk %s can't be found: %v", chunkID, err)
} else {
LOG_FATAL("DOWNLOAD_CHUNK", "Chunk %s can't be found", chunkID)
}
return false
}
LOG_DEBUG("CHUNK_FOSSIL", "Chunk %s has been marked as a fossil", chunkID)