Handle all HTTP codes, not just 404

This commit is contained in:
Michael 2022-03-17 17:42:05 -05:00
parent 1f533ff3e9
commit 521322a013
Signed by: TheShadowEevee
GPG key ID: 7A8AA92B3BAFAB75
2 changed files with 7 additions and 7 deletions

View file

@ -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)

View file

@ -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);