mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 13:14:17 +01:00
pi: treat cancellations as errors(fixes #1825)
This commit is contained in:
parent
16f0fb76f4
commit
38eac377a1
1 changed files with 11 additions and 10 deletions
|
|
@ -364,10 +364,13 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
/// <returns>A value indicating whether to continue with the next task.</returns>
|
/// <returns>A value indicating whether to continue with the next task.</returns>
|
||||||
public bool DisplayErrorContinuation(Task task, object state)
|
public bool DisplayErrorContinuation(Task task, object state)
|
||||||
{
|
{
|
||||||
if (task.IsFaulted)
|
if (!task.IsFaulted && !task.IsCanceled)
|
||||||
{
|
return true;
|
||||||
var errorModalMessage = state as string;
|
|
||||||
|
var newErrorMessage = state as string;
|
||||||
|
|
||||||
|
if (task.Exception != null)
|
||||||
|
{
|
||||||
foreach (var ex in task.Exception.InnerExceptions)
|
foreach (var ex in task.Exception.InnerExceptions)
|
||||||
{
|
{
|
||||||
if (ex is PluginException)
|
if (ex is PluginException)
|
||||||
|
|
@ -375,7 +378,7 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
Log.Error(ex, "Plugin installer threw an error");
|
Log.Error(ex, "Plugin installer threw an error");
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
if (!string.IsNullOrEmpty(ex.Message))
|
if (!string.IsNullOrEmpty(ex.Message))
|
||||||
errorModalMessage += $"\n\n{ex.Message}";
|
newErrorMessage += $"\n\n{ex.Message}";
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -383,17 +386,15 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
Log.Error(ex, "Plugin installer threw an unexpected error");
|
Log.Error(ex, "Plugin installer threw an unexpected error");
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
if (!string.IsNullOrEmpty(ex.Message))
|
if (!string.IsNullOrEmpty(ex.Message))
|
||||||
errorModalMessage += $"\n\n{ex.Message}";
|
newErrorMessage += $"\n\n{ex.Message}";
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.ShowErrorModal(errorModalMessage);
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
this.ShowErrorModal(newErrorMessage ?? "An unknown error occurred.");
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetOpenPage(PluginInstallerOpenKind kind)
|
private void SetOpenPage(PluginInstallerOpenKind kind)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue