mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Error handling for modlist download exceptions
This commit is contained in:
parent
5b33a74075
commit
bc6580c846
@ -7,8 +7,8 @@ namespace Wabbajack
|
||||
public readonly static ErrorResponse Success = Succeed();
|
||||
public readonly static ErrorResponse Failure = new ErrorResponse();
|
||||
|
||||
public readonly bool Succeeded;
|
||||
public readonly Exception Exception;
|
||||
public bool Succeeded { get; }
|
||||
public Exception Exception { get; }
|
||||
private readonly string _reason;
|
||||
|
||||
public bool Failed => !Succeeded;
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
@ -39,6 +39,9 @@ namespace Wabbajack
|
||||
[Reactive]
|
||||
public bool IsBroken { get; private set; }
|
||||
|
||||
[Reactive]
|
||||
public IErrorResponse Error { get; private set; }
|
||||
|
||||
private readonly ObservableAsPropertyHelper<BitmapImage> _Image;
|
||||
public BitmapImage Image => _Image.Value;
|
||||
|
||||
@ -61,7 +64,15 @@ namespace Wabbajack
|
||||
{
|
||||
if (!exists)
|
||||
{
|
||||
await Download();
|
||||
try
|
||||
{
|
||||
await Download();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Error = ErrorResponse.Fail(ex);
|
||||
return false;
|
||||
}
|
||||
// Return an updated check on exists
|
||||
return File.Exists(Location);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
<rxui:ReactiveUserControl
|
||||
<rxui:ReactiveUserControl
|
||||
x:Class="Wabbajack.ModListTileView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
@ -260,6 +260,18 @@
|
||||
<Setter Property="Padding" Value="3,0,0,0" />
|
||||
</MultiDataTrigger.Setters>
|
||||
</MultiDataTrigger>
|
||||
<DataTrigger Binding="{Binding Error.Succeeded}" Value="False">
|
||||
<Setter Property="Content">
|
||||
<Setter.Value>
|
||||
<iconPacks:Material
|
||||
Width="20"
|
||||
Height="20"
|
||||
Kind="AlertCircle" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="ToolTip" Value="Error downloading modlist. Check logs and/or restart Wabbajack to try again." />
|
||||
<Setter Property="Foreground" Value="{StaticResource ErrorBrush}" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
|
Loading…
Reference in New Issue
Block a user