fixes and macos stuff
This commit is contained in:
parent
9695ceec8a
commit
801a8d1754
10 changed files with 108 additions and 115 deletions
|
@ -39,7 +39,7 @@ namespace {
|
|||
DEBUG_LOG("Reading from cache file...");
|
||||
|
||||
try {
|
||||
const String content((std::istreambuf_iterator(ifs)), std::istreambuf_iterator<char>());
|
||||
const String content((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>());
|
||||
WeatherOutput result;
|
||||
|
||||
if (const glz::error_ctx errc = glz::read<glaze_opts>(result, content); errc.ec != glz::error_code::none)
|
||||
|
@ -79,7 +79,9 @@ namespace {
|
|||
std::error_code errc;
|
||||
fs::rename(tempPath, *cachePath, errc);
|
||||
if (errc) {
|
||||
fs::remove(tempPath, errc);
|
||||
if (!fs::remove(tempPath, errc))
|
||||
DEBUG_LOG("Failed to remove temp file: {}", errc.message());
|
||||
|
||||
return Err("Failed to replace cache file: " + errc.message());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue