From fa294eabf47d5c1c7d46b7cfc54440c7c1e3ef58 Mon Sep 17 00:00:00 2001 From: Gilbert Chen Date: Tue, 1 Aug 2017 23:08:11 -0400 Subject: [PATCH] When a chunk can't be found, print the error if it is not nil --- src/duplicacy_chunkdownloader.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/duplicacy_chunkdownloader.go b/src/duplicacy_chunkdownloader.go index 65bd82e..454cc9f 100644 --- a/src/duplicacy_chunkdownloader.go +++ b/src/duplicacy_chunkdownloader.go @@ -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)