add try...catch

Докинул try catch, ибо иногда падал и было непонятно на каком репозитории
This commit is contained in:
Anton Volkov
2020-04-13 11:25:24 +03:00
parent abd89dd41e
commit 5c01943fc6
2 changed files with 52 additions and 35 deletions
+6
View File
@@ -0,0 +1,6 @@
<SolutionConfiguration>
<Settings>
<AllowParallelTestExecution>True</AllowParallelTestExecution>
<SolutionConfigured>True</SolutionConfigured>
</Settings>
</SolutionConfiguration>
@@ -7,8 +7,10 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.ServiceModel.Channels;
using System.Text;
using System.Threading;
using System.Windows.Forms;
namespace JiraTimeBot.RepositoryProviders
{
@@ -72,6 +74,8 @@ namespace JiraTimeBot.RepositoryProviders
AdditionalArguments = { "--encoding=utf-8" },
};
try
{
var log = repo.Log(logCommand);
foreach (var changeset in log)
@@ -116,6 +120,13 @@ namespace JiraTimeBot.RepositoryProviders
_log?.Trace($" - Найден changeset: {changeset.Timestamp} - {changeset.Branch} - {changeset.AuthorEmailAddress} - {commitMessage}");
}
}
catch (Exception e)
{
MessageBox.Show($"Oops something went wrong in repo {repoDirectory}");
throw;
}
}
if (!workTasks.Any())
{
return new List<TaskTimeItem>();