Skip to content

Commit

Permalink
Log commit failures more clearly
Browse files Browse the repository at this point in the history
  • Loading branch information
geluk committed Jan 22, 2021
1 parent e2232e8 commit aa65463
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions pass-winmenu/src/Actions/CommitChangesAction.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using LibGit2Sharp;
using PassWinmenu.Configuration;
using PassWinmenu.ExternalPrograms;
Expand Down Expand Up @@ -34,8 +35,19 @@ public void Execute()
return;
}

// First, commit any uncommitted files
syncService.Commit();
try
{
// First, commit any uncommitted files
syncService.Commit();
}
catch (Exception e)
{
notificationService.ShowErrorWindow(
$"Unable to commit your changes. An error occurred: {e.GetType().Name} ({e.Message})");
Log.ReportException(e);
return;
}

// Now fetch the latest changes
try
{
Expand Down

0 comments on commit aa65463

Please sign in to comment.