mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 12:45:00 +00:00
enhance: only log exception in popup task (#1281)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
4bc5b90e6b
commit
eae6d10784
2 changed files with 17 additions and 8 deletions
|
@ -78,7 +78,7 @@ namespace SourceGit
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void LogException(Exception ex)
|
public static void LogException(Exception ex)
|
||||||
{
|
{
|
||||||
if (ex == null)
|
if (ex == null)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -100,23 +100,32 @@ namespace SourceGit.ViewModels
|
||||||
|
|
||||||
public async void ProcessPopup()
|
public async void ProcessPopup()
|
||||||
{
|
{
|
||||||
if (_popup is { InProgress: false })
|
if (_popup is { InProgress: false } dump)
|
||||||
{
|
{
|
||||||
if (!_popup.Check())
|
if (!dump.Check())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_popup.InProgress = true;
|
dump.InProgress = true;
|
||||||
var task = _popup.Sure();
|
var task = dump.Sure();
|
||||||
|
var finished = false;
|
||||||
if (task != null)
|
if (task != null)
|
||||||
{
|
{
|
||||||
var finished = await task;
|
try
|
||||||
_popup.InProgress = false;
|
{
|
||||||
|
finished = await task;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
App.LogException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
dump.InProgress = false;
|
||||||
if (finished)
|
if (finished)
|
||||||
Popup = null;
|
Popup = null;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_popup.InProgress = false;
|
dump.InProgress = false;
|
||||||
Popup = null;
|
Popup = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue