diff --git a/Knossos.NET/Models/Nebula.cs b/Knossos.NET/Models/Nebula.cs index 8c47bdc7..accd5dbf 100644 --- a/Knossos.NET/Models/Nebula.cs +++ b/Knossos.NET/Models/Nebula.cs @@ -789,7 +789,7 @@ private enum ApiMethod { var reply = JsonSerializer.Deserialize(jsonReply); if (!reply.result && resourceUrl != "mod/check_id") - Log.Add(Log.LogSeverity.Error, "Nebula.ApiCall(" + resourceUrl + ")", "An error has ocurred during nebula api POST call: " + response.StatusCode + "(" + (int)response.StatusCode + ")\n" + data); + Log.Add(Log.LogSeverity.Error, "Nebula.ApiCall(" + resourceUrl + ")", "An error has ocurred during nebula api POST call. Status: " + response.StatusCode + "(" + (int)response.StatusCode + "). Reply: \n" + jsonReply + "\n"); return reply; } @@ -924,7 +924,10 @@ private enum ApiMethod } else { - Log.Add(Log.LogSeverity.Error, "Nebula.GetModJson", "Unable to get mod json data. ID: " + modid + " Version: " + version + " Reason: " + reply.Value.reason); + if(reply.Value.reason == "not_found") + Log.Add(Log.LogSeverity.Warning, "Nebula.GetModJson", "Mod ID + Version not found on Nebula. ID: " + modid + " Version: " + version + " Reason: " + reply.Value.reason); + else + Log.Add(Log.LogSeverity.Error, "Nebula.GetModJson", "Unable to get mod json data. ID: " + modid + " Version: " + version + " Reason: " + reply.Value.reason); } } } diff --git a/Knossos.NET/ViewModels/Templates/Tasks/PreFlightCheck.cs b/Knossos.NET/ViewModels/Templates/Tasks/PreFlightCheck.cs index 8f8458cb..8e8635f5 100644 --- a/Knossos.NET/ViewModels/Templates/Tasks/PreFlightCheck.cs +++ b/Knossos.NET/ViewModels/Templates/Tasks/PreFlightCheck.cs @@ -55,12 +55,11 @@ private async Task PreFlightCheck(Mod mod, CancellationTokenSource? canc { if (result != null) { - Info = "Preflight check failed. Reason: " + result; + throw new TaskCanceledException("Preflight failed. Reason: " + result); } else { - Info = "Preflight check failed for unknown reasons."; - throw new TaskCanceledException(); + throw new TaskCanceledException("Preflight failed for unknown reasons."); } } Info = result; @@ -74,13 +73,13 @@ private async Task PreFlightCheck(Mod mod, CancellationTokenSource? canc throw new Exception("The task is already set, it cant be changed or re-assigned."); } } - catch (TaskCanceledException) + catch (TaskCanceledException tc) { //Task cancel requested by user IsCompleted = false; IsCancelled = true; CancelButtonVisible = false; - Info = "Task Cancelled"; + Info = tc.InnerException?.Message != null ? tc.InnerException.Message : "Task Cancelled"; //Only dispose the token if it was created locally if (cancelSource == null) { diff --git a/Knossos.NET/ViewModels/Templates/Tasks/ReleaseMod.cs b/Knossos.NET/ViewModels/Templates/Tasks/ReleaseMod.cs index e6857115..14236e4f 100644 --- a/Knossos.NET/ViewModels/Templates/Tasks/ReleaseMod.cs +++ b/Knossos.NET/ViewModels/Templates/Tasks/ReleaseMod.cs @@ -87,12 +87,11 @@ private async Task ReleaseMod(Mod mod, bool metaUpdate, CancellationToke { if (result != null) { - Info = "Release Mod failed. Reason: " + result; + throw new TaskCanceledException("Release Mod failed. Reason: " + result); } else { - Info = "Release Mod failed for unknown reasons."; - throw new TaskCanceledException(); + throw new TaskCanceledException("Release Mod failed for unknown reasons."); } } Info = result; @@ -106,13 +105,13 @@ private async Task ReleaseMod(Mod mod, bool metaUpdate, CancellationToke throw new Exception("The task is already set, it cant be changed or re-assigned."); } } - catch (TaskCanceledException) + catch (TaskCanceledException tc) { //Task cancel requested by user IsCompleted = false; IsCancelled = true; CancelButtonVisible = false; - Info = "Task Cancelled"; + Info = tc.InnerException?.Message != null ? tc.InnerException.Message : "Task cancelled"; //Only dispose the token if it was created locally if (cancelSource == null) {