From a21adf5ff32b41449f28eaa4ce71421ddbe33f21 Mon Sep 17 00:00:00 2001 From: Salvador Cipolla Date: Wed, 8 Apr 2026 20:13:37 -0300 Subject: [PATCH 1/2] Fix weird nebula log and incorrect succes mod upload report on fail --- Knossos.NET/Models/Nebula.cs | 7 +++++-- Knossos.NET/ViewModels/Templates/Tasks/ReleaseMod.cs | 9 ++++----- 2 files changed, 9 insertions(+), 7 deletions(-) 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/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) { From 17ebda164500c17c14156336e1f294ef1bcee7de Mon Sep 17 00:00:00 2001 From: Salvador Cipolla Date: Thu, 9 Apr 2026 20:29:43 -0300 Subject: [PATCH 2/2] fix preflightcheck falltrought as well --- Knossos.NET/ViewModels/Templates/Tasks/PreFlightCheck.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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) {