Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit ab46fdc

Browse files
committed
Trace log important exceptions
1 parent b35d026 commit ab46fdc

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

src/GitHub.Api/Installer/GitInstaller.cs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,12 @@ private GitInstallationState GetZipsIfNeeded(GitInstallationState state)
218218
return state;
219219

220220
var downloader = new Downloader();
221-
downloader.Catch(e => true);
221+
downloader
222+
.Catch(e =>
223+
{
224+
LogHelper.Trace(e, "Failed to download");
225+
return true;
226+
});
222227
downloader.Progress(p => ((Progress)Progress)?.UpdateProgress(20 + (long)(20 * p.Percentage), 100, downloader.Name));
223228
if (!state.GitZipExists && !state.GitIsValid && state.GitPackage != null)
224229
downloader.QueueDownload(state.GitPackage.Uri, installDetails.ZipPath);
@@ -255,7 +260,11 @@ private GitInstallationState ExtractGit(GitInstallationState state)
255260
var unzipTask = new UnzipTask(cancellationToken, installDetails.GitZipPath,
256261
gitExtractPath, sharpZipLibHelper,
257262
environment.FileSystem)
258-
.Catch(e => true);
263+
.Catch(e =>
264+
{
265+
LogHelper.Trace(e, "Failed to unzip " + installDetails.GitZipPath);
266+
return true;
267+
});
259268
unzipTask.Progress(p => ((Progress)Progress)?.UpdateProgress(40 + (long)(20 * p.Percentage), 100, unzipTask.Name));
260269
var path = unzipTask.RunWithReturn(true);
261270
var target = state.GitInstallationPath;
@@ -276,7 +285,11 @@ private GitInstallationState ExtractGit(GitInstallationState state)
276285
var unzipTask = new UnzipTask(cancellationToken, installDetails.GitLfsZipPath,
277286
gitLfsExtractPath, sharpZipLibHelper,
278287
environment.FileSystem)
279-
.Catch(e => true);
288+
.Catch(e =>
289+
{
290+
LogHelper.Trace(e, "Failed to unzip " + installDetails.GitLfsZipPath);
291+
return true;
292+
});
280293
unzipTask.Progress(p => ((Progress)Progress)?.UpdateProgress(60 + (long)(20 * p.Percentage), 100, unzipTask.Name));
281294
var path = unzipTask.RunWithReturn(true);
282295
var target = state.GitLfsExecutablePath;

src/GitHub.Api/Primitives/Package.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,12 @@ public static Package Load(IEnvironment environment, UriString packageFeed)
3333
if (!feed.FileExists() || now.Date > environment.UserSettings.Get<DateTimeOffset>(key).Date)
3434
{
3535
feed = new DownloadTask(TaskManager.Instance.Token, environment.FileSystem, packageFeed, environment.UserCachePath)
36-
.Catch(e => true)
37-
.RunWithReturn(true);
36+
.Catch(e =>
37+
{
38+
LogHelper.Trace(e, "Failed to download " + packageFeed);
39+
return true;
40+
})
41+
.RunWithReturn(true);
3842

3943
if (feed.IsInitialized)
4044
environment.UserSettings.Set<DateTimeOffset>(key, now);

0 commit comments

Comments
 (0)