@@ -210,7 +210,7 @@ void Http::Download(
210
210
ScopedFile fp (fsbridge::fopen (destination, " wb" ), &fclose );
211
211
if (!fp)
212
212
throw std::runtime_error (
213
- tfm::format (" Error opening target %s: %s (%d)" , destination, strerror (errno), errno));
213
+ tfm::strformat (" Error opening target %s: %s (%d)" , destination, strerror (errno), errno));
214
214
215
215
std::string buffer;
216
216
ScopedCurl curl = GetContext ();
@@ -221,7 +221,7 @@ void Http::Download(
221
221
222
222
CURLcode res = curl_easy_perform (curl.get ());
223
223
if (res > 0 )
224
- throw std::runtime_error (tfm::format (" Failed to download file %s: %s" , url, curl_easy_strerror (res)));
224
+ throw std::runtime_error (tfm::strformat (" Failed to download file %s: %s" , url, curl_easy_strerror (res)));
225
225
}
226
226
227
227
std::string Http::GetEtag (
@@ -247,7 +247,7 @@ std::string Http::GetEtag(
247
247
curl_slist_free_all (headers);
248
248
249
249
if (res > 0 )
250
- throw std::runtime_error (tfm::format (" Failed to get ETag for URL %s: %s" , url, curl_easy_strerror (res)));
250
+ throw std::runtime_error (tfm::strformat (" Failed to get ETag for URL %s: %s" , url, curl_easy_strerror (res)));
251
251
252
252
// Validate HTTP return code.
253
253
long response_code;
@@ -291,7 +291,7 @@ std::string Http::GetLatestVersionResponse()
291
291
CURLcode res = curl_easy_perform (curl.get ());
292
292
293
293
if (res > 0 )
294
- throw std::runtime_error (tfm::format (" Failed to get version response from URL %s: %s" ,
294
+ throw std::runtime_error (tfm::strformat (" Failed to get version response from URL %s: %s" ,
295
295
url, curl_easy_strerror (res)));
296
296
297
297
curl_slist_free_all (headers);
@@ -320,7 +320,7 @@ void Http::DownloadSnapshot()
320
320
DownloadStatus.SetSnapshotDownloadFailed (true );
321
321
322
322
throw std::runtime_error (
323
- tfm::format (" Snapshot Downloader: Error opening target %s: %s (%d)" ,
323
+ tfm::strformat (" Snapshot Downloader: Error opening target %s: %s (%d)" ,
324
324
destination.string (), strerror (errno), errno));
325
325
}
326
326
@@ -374,7 +374,7 @@ void Http::DownloadSnapshot()
374
374
{
375
375
DownloadStatus.SetSnapshotDownloadFailed (true );
376
376
377
- throw std::runtime_error (tfm::format (" Snapshot Downloader: Failed to download file %s: %s" ,
377
+ throw std::runtime_error (tfm::strformat (" Snapshot Downloader: Failed to download file %s: %s" ,
378
378
url, curl_easy_strerror (res)));
379
379
}
380
380
}
@@ -458,13 +458,13 @@ void Http::EvaluateResponse(int code, const std::string& url)
458
458
code == 308 )
459
459
return ;
460
460
else if (code == 400 )
461
- throw HttpException (tfm::format (" Server returned a http code of Bad Request <url=%s, code=%d>" , url, code));
461
+ throw HttpException (tfm::strformat (" Server returned a http code of Bad Request <url=%s, code=%d>" , url, code));
462
462
else if (code == 401 )
463
- throw HttpException (tfm::format (" Server returned a http code of Unauthorized <url=%s, code=%d>" , url, code));
463
+ throw HttpException (tfm::strformat (" Server returned a http code of Unauthorized <url=%s, code=%d>" , url, code));
464
464
else if (code == 403 )
465
- throw HttpException (tfm::format (" Server returned a http code of Forbidden <url=%s, code=%d>" , url, code));
465
+ throw HttpException (tfm::strformat (" Server returned a http code of Forbidden <url=%s, code=%d>" , url, code));
466
466
else if (code == 404 )
467
- throw HttpException (tfm::format (" Server returned a http code of Not Found <url=%s, code=%d>" , url, code));
467
+ throw HttpException (tfm::strformat (" Server returned a http code of Not Found <url=%s, code=%d>" , url, code));
468
468
469
- throw HttpException (tfm::format (" Server returned a http code <url=%s, code=%d>" , url, code));
469
+ throw HttpException (tfm::strformat (" Server returned a http code <url=%s, code=%d>" , url, code));
470
470
}
0 commit comments