Skip to content

Commit 5b4494f

Browse files
committed
lib download error logging
1 parent 3098273 commit 5b4494f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

FModel/ViewModels/ApplicationViewModel.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,11 @@ public static async ValueTask InitOodle()
249249

250250
if (!File.Exists(oodlePath))
251251
{
252-
await OodleHelper.DownloadOodleDllAsync(oodlePath);
252+
if (!await OodleHelper.DownloadOodleDllAsync(oodlePath))
253+
{
254+
FLogger.Append(ELog.Error, () => FLogger.Text("Failed to download Oodle", Constants.WHITE, true));
255+
return;
256+
}
253257
}
254258

255259
OodleHelper.Initialize(oodlePath);
@@ -262,7 +266,11 @@ public static async ValueTask InitZlib()
262266

263267
if (!zlibFileInfo.Exists || zlibFileInfo.LastWriteTimeUtc < DateTime.UtcNow.AddMonths(-4))
264268
{
265-
await ZlibHelper.DownloadDllAsync(zlibPath);
269+
if (!await ZlibHelper.DownloadDllAsync(zlibPath))
270+
{
271+
FLogger.Append(ELog.Error, () => FLogger.Text("Failed to download Zlib-ng", Constants.WHITE, true));
272+
if (!zlibFileInfo.Exists) return;
273+
}
266274
}
267275

268276
ZlibHelper.Initialize(zlibPath);

0 commit comments

Comments
 (0)