Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Knossos.NET/Models/Nebula.cs
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ private enum ApiMethod
{
var reply = JsonSerializer.Deserialize<ApiReply>(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;
}
Expand Down Expand Up @@ -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);
}
}
}
Expand Down
9 changes: 4 additions & 5 deletions Knossos.NET/ViewModels/Templates/Tasks/PreFlightCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@ private async Task<string> 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;
Expand All @@ -74,13 +73,13 @@ private async Task<string> 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)
{
Expand Down
9 changes: 4 additions & 5 deletions Knossos.NET/ViewModels/Templates/Tasks/ReleaseMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,11 @@ private async Task<string> 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;
Expand All @@ -106,13 +105,13 @@ private async Task<string> 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)
{
Expand Down