Added an error and proper codes for not having all the files when packing a wad.

Added an error and proper codes for not having all the files when packing a wad. Previously would return the cryptic "Index was outside the bounds of the array." error.
This commit is contained in:
Shadow Eevee 2020-03-08 22:00:28 -07:00
parent 2fb3e21d2d
commit 588a692b05
4 changed files with 44 additions and 7 deletions

View file

@ -572,6 +572,16 @@ namespace Sharpii
Console.WriteLine("");
ErrCodeFound = 1;
}
if (args[1] == "SHARPII_NET_CORE_NUSD_MISSING_FILES_01")
{
Console.WriteLine("");
Console.WriteLine("You need to have all the required .app files, a tmd file, a tik file, and a cert file to pack a wad.");
Console.WriteLine("Ensure all files are present");
Console.WriteLine("If that doesn't help, open an issue on GitHub!");
Console.WriteLine("https://github.com/TheShadowEevee/Sharpii-NetCore/issues");
Console.WriteLine("");
ErrCodeFound = 1;
}
if (ErrCodeFound != 1)
{
Error_help();

View file

@ -344,6 +344,17 @@ namespace Sharpii
Console.WriteLine("");
ErrCodeFound = 1;
}
if (args[1] == "16029")
{
Console.WriteLine("");
Console.WriteLine("Not all files needed to pack a wad are present. (SHARPII_NET_CORE_NUSD_MISSING_FILES_01)");
Console.WriteLine("You need to have all the required .app files, a tmd file, a tik file, and a cert file to pack a wad.");
Console.WriteLine("Ensure all files are present");
Console.WriteLine("If that doesn't help, open an issue on GitHub!");
Console.WriteLine("https://github.com/TheShadowEevee/Sharpii-NetCore/issues");
Console.WriteLine("");
ErrCodeFound = 1;
}
if (ErrCodeFound != 1)
{
ExitCode_help();

View file

@ -143,4 +143,9 @@ Provide a proper wad.
Exit Code: 16028
ID Flag was used, but invalid id provided. (SHARPII_NET_CORE_xxx_BAD_ID_01)
You used the -ID flag, but an invalid id was provided.
Provide a proper id.
Provide a proper id.
Exit Code: 16029
Not all files needed to pack a wad are present. (SHARPII_NET_CORE_NUSD_MISSING_FILES_01)
You need to have all the required .app files, a tmd file, a tik file, and a cert file to pack a wad.
Ensure all files are present.

View file

@ -23,6 +23,7 @@ namespace Sharpii
{
partial class WAD_Stuff
{
public static int ExceptionListRan = 0;
public static void WAD(string[] args)
{
if (args.Length < 3)
@ -586,12 +587,22 @@ namespace Sharpii
}
catch (Exception ex)
{
Console.WriteLine("An unknown error occured, please try again");
Console.WriteLine("");
Console.WriteLine("ERROR DETAILS: {0}", ex.Message);
Console.WriteLine("Error: SHARPII_NET_CORE_WAD_UNKNOWN_01");
Environment.Exit(0x00003E82);
return;
if (ex.Message == "Index was outside the bounds of the array.")
{
Console.WriteLine("You need to have all the required .app files, a tmd file, a tik file, and a cert file to do this.");
Console.WriteLine("");
Console.WriteLine("Error: SHARPII_NET_CORE_NUSD_MISSING_FILES_01");
ExceptionListRan = 1;
Environment.Exit(0x00003E9D);
}
if (ExceptionListRan == 0)
{
Console.WriteLine("An unknown error occured, please try again");
Console.WriteLine("");
Console.WriteLine("ERROR DETAILS: {0}", ex.Message);
Console.WriteLine("Error: SHARPII_NET_CORE_WAD_UNKNOWN_01");
Environment.Exit(0x00003E82);
}
}
}