From 521322a0137a966dad3319491838dbc141950f6a Mon Sep 17 00:00:00 2001 From: TheShadowEevee Date: Thu, 17 Mar 2022 17:42:05 -0500 Subject: [PATCH] Handle all HTTP codes, not just 404 --- Sharpii/Exit Codes.txt | 5 +++-- Sharpii/NUSD.cs | 9 ++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Sharpii/Exit Codes.txt b/Sharpii/Exit Codes.txt index 52853e2..af357e6 100644 --- a/Sharpii/Exit Codes.txt +++ b/Sharpii/Exit Codes.txt @@ -156,9 +156,10 @@ You need to have all the required .app files, a tmd file, a tik file, and a cert Ensure all files are present. Exit Code: 16030/32 -Invalid ID or Missing CETK (SHARPII_NET_CORE_NUSD_REMOTE_404) -The remote server returned a 404 error. Check your Title ID. +Invalid ID or Missing CETK (SHARPII_NET_CORE_NUSD_SERVER_ERROR) +The remote server returned an HTTP error. Check your Title ID. If you have a CETK file, please place it in the same directory as Sharpii saves the NUS Files to. +The server may also actually be having issues. Exit Code: 16031/33 A WebRequest Error has occured and stopped a NUS download. (SHARPII_NET_CORE_NUSD_WEBREQUEST_FAIL) diff --git a/Sharpii/NUSD.cs b/Sharpii/NUSD.cs index 73f1040..d0b4187 100644 --- a/Sharpii/NUSD.cs +++ b/Sharpii/NUSD.cs @@ -328,13 +328,12 @@ namespace Sharpii } return; } - if (ex.Message == "The remote server returned an error: (404) Not Found.") + if (ex.Message.Contains("The remote server returned an error:")) { + Console.WriteLine("The remote server returned an HTTP error. Check your Title ID."); Console.WriteLine(""); - Console.WriteLine("The remote server returned a 404 error. Check your Title ID."); - Console.WriteLine(""); - Console.WriteLine("Error: SHARPII_NET_CORE_NUSD_REMOTE_404"); - Console.WriteLine(""); + Console.WriteLine("ERROR DETAILS: {0}", ex.Message); + Console.WriteLine("Error: SHARPII_NET_CORE_NUSD_SERVER_ERROR"); if (OperatingSystem.Windows()) { Environment.Exit(0x00003E9E);