diff --git a/src/App.axaml.cs b/src/App.axaml.cs index f59d35db..af5e6177 100644 --- a/src/App.axaml.cs +++ b/src/App.axaml.cs @@ -532,7 +532,7 @@ namespace SourceGit catch (Exception e) { if (manually) - ShowSelfUpdateResult(e); + ShowSelfUpdateResult(new Models.SelfUpdateFailed(e)); } }); } diff --git a/src/Models/Version.cs b/src/Models/SelfUpdate.cs similarity index 65% rename from src/Models/Version.cs rename to src/Models/SelfUpdate.cs index 35c21778..e02f80d8 100644 --- a/src/Models/Version.cs +++ b/src/Models/SelfUpdate.cs @@ -1,4 +1,5 @@ -using System.Reflection; +using System; +using System.Reflection; using System.Text.Json.Serialization; namespace SourceGit.Models @@ -32,5 +33,24 @@ namespace SourceGit.Models } } - public class AlreadyUpToDate { } + public class AlreadyUpToDate + { + } + + public class SelfUpdateFailed + { + public string Reason + { + get; + private set; + } + + public SelfUpdateFailed(Exception e) + { + if (e.InnerException is { } inner) + Reason = inner.Message; + else + Reason = e.Message; + } + } } diff --git a/src/Views/SelfUpdate.axaml b/src/Views/SelfUpdate.axaml index 0a6fef34..2d5990e7 100644 --- a/src/Views/SelfUpdate.axaml +++ b/src/Views/SelfUpdate.axaml @@ -5,7 +5,6 @@ xmlns:m="using:SourceGit.Models" xmlns:vm="using:SourceGit.ViewModels" xmlns:v="using:SourceGit.Views" - xmlns:sys="clr-namespace:System;assembly=mscorlib" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="SourceGit.Views.SelfUpdate" x:DataType="vm:SelfUpdate" @@ -87,26 +86,6 @@ - - - - - - - - - -