Skip to content

Commit 597c5c9

Browse files
committed
catch exceptioninstead of error code
1 parent 81b33cc commit 597c5c9

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

source/gameanalytics/GAStore.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,16 @@ namespace gameanalytics
216216

217217
if(std::filesystem::exists(oldPath) && !std::filesystem::exists(dbPath))
218218
{
219-
std::error_code ec = {};
220-
std::filesystem::rename(oldPath, dbPath, ec);
219+
try
220+
{
221+
std::filesystem::rename(oldPath, dbPath);
222+
}
223+
catch(...)
224+
{
225+
return false;
226+
}
221227

222-
return ec.value() != 0;
228+
return true;
223229
}
224230

225231
return false;

0 commit comments

Comments
 (0)