mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Global UserInterventionHandler now try/catches
Any exception was borking the callback subscription, so no more interventions were handled
This commit is contained in:
parent
c9f3fabd69
commit
e13b000b54
@ -74,7 +74,29 @@ namespace Wabbajack
|
||||
Utils.LogMessages
|
||||
.OfType<IUserIntervention>()
|
||||
.ObserveOnGuiThread()
|
||||
.SelectTask(msg => UserInterventionHandlers.Handle(msg))
|
||||
.SelectTask(async msg =>
|
||||
{
|
||||
try
|
||||
{
|
||||
await UserInterventionHandlers.Handle(msg);
|
||||
}
|
||||
catch (Exception ex)
|
||||
when (ex.GetType() != typeof(TaskCanceledException))
|
||||
{
|
||||
Utils.Error(ex, $"Error while handling user intervention of type {msg?.GetType()}");
|
||||
try
|
||||
{
|
||||
if (!msg.Handled)
|
||||
{
|
||||
msg.Cancel();
|
||||
}
|
||||
}
|
||||
catch (Exception cancelEx)
|
||||
{
|
||||
Utils.Error(cancelEx, $"Error while cancelling user intervention of type {msg?.GetType()}");
|
||||
}
|
||||
}
|
||||
})
|
||||
.Subscribe()
|
||||
.DisposeWith(CompositeDisposable);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user