about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-07-10T20·27+0200
committerEelco Dolstra <edolstra@gmail.com>2019-07-10T20·27+0200
commitf76b2a7fdd7dabad7891400248f5cc778182ebf3 (patch)
tree7da4c07d44a34bb5dc06fe1ac8902ab8986c5807
parent03f09e1d18c39706b917964f14f9e40513e4aaea (diff)
Downloader: Use warn()
-rw-r--r--src/libstore/download.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstore/download.cc b/src/libstore/download.cc
index 2267b5d35178..195eccc2a12d 100644
--- a/src/libstore/download.cc
+++ b/src/libstore/download.cc
@@ -406,7 +406,7 @@ struct CurlDownloader : public Downloader
                    download after a while. */
                 if (err == Transient && attempt < request.tries) {
                     int ms = request.baseRetryTimeMs * std::pow(2.0f, attempt - 1 + std::uniform_real_distribution<>(0.0, 0.5)(downloader.mt19937));
-                    printError(format("warning: %s; retrying in %d ms") % exc.what() % ms);
+                    warn("%s; retrying in %d ms", exc.what(), ms);
                     embargo = std::chrono::steady_clock::now() + std::chrono::milliseconds(ms);
                     downloader.enqueueItem(shared_from_this());
                 }
@@ -579,7 +579,7 @@ struct CurlDownloader : public Downloader
             workerThreadMain();
         } catch (nix::Interrupted & e) {
         } catch (std::exception & e) {
-            printError(format("unexpected error in download thread: %s") % e.what());
+            printError("unexpected error in download thread: %s", e.what());
         }
 
         {
@@ -869,7 +869,7 @@ CachedDownloadResult Downloader::downloadCached(
             writeFile(dataFile, url + "\n" + res.etag + "\n" + std::to_string(time(0)) + "\n");
         } catch (DownloadError & e) {
             if (storePath.empty()) throw;
-            printError(format("warning: %1%; using cached result") % e.msg());
+            warn("warning: %s; using cached result", e.msg());
             result.etag = expectedETag;
         }
     }