Skip to content

Commit

Permalink
ref - Use GetErrorCode() in all commands
Browse files Browse the repository at this point in the history
---

Type: ref
Breaking: False
Doc Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Feb 9, 2024
1 parent 711e59a commit 9192a22
Show file tree
Hide file tree
Showing 221 changed files with 549 additions and 549 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal
else
{
TextWriters.Write(Translate.DoTranslation("File doesn't exist."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Filesystem;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Filesystem);
}
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal
if (!ArchiveTools.ChangeWorkingArchiveDirectory(parameters.ArgumentsList[0]))
{
TextWriters.Write(Translate.DoTranslation("Archive directory {0} doesn't exist"), true, KernelColorType.Error, parameters.ArgumentsList[0]);
return 10000 + (int)KernelExceptionType.Archive;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Archive);
}
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal
if (!ArchiveTools.ChangeWorkingArchiveLocalDirectory(parameters.ArgumentsList[0]))
{
TextWriters.Write(Translate.DoTranslation("Directory {0} doesn't exist"), true, KernelColorType.Error, parameters.ArgumentsList[0]);
return 10000 + (int)KernelExceptionType.Archive;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Archive);
}
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal
else
{
TextWriters.Write(Translate.DoTranslation("Not enough arguments provided to add an event."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Calendar;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Calendar);
}

return 0;
Expand Down Expand Up @@ -152,7 +152,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal
else
{
TextWriters.Write(Translate.DoTranslation("Not enough arguments provided to remove an event."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Calendar;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Calendar);
}

return 0;
Expand All @@ -173,14 +173,14 @@ public override int Execute(CommandParameters parameters, ref string variableVal
{
// Invalid action.
TextWriters.Write(Translate.DoTranslation("Invalid action."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Calendar;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Calendar);
}
}
}
else
{
TextWriters.Write(Translate.DoTranslation("Not enough arguments provided for event manipulation."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Calendar;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Calendar);
}
}
case "reminder":
Expand Down Expand Up @@ -216,7 +216,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal
else
{
TextWriters.Write(Translate.DoTranslation("Not enough arguments provided to add a reminder."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Calendar;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Calendar);
}

return 0;
Expand Down Expand Up @@ -244,7 +244,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal
else
{
TextWriters.Write(Translate.DoTranslation("Not enough arguments provided to remove a reminder."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Calendar;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Calendar);
}

return 0;
Expand All @@ -265,21 +265,21 @@ public override int Execute(CommandParameters parameters, ref string variableVal
{
// Invalid action.
TextWriters.Write(Translate.DoTranslation("Invalid action."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Calendar;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Calendar);
}
}
}
else
{
TextWriters.Write(Translate.DoTranslation("Not enough arguments provided for reminder manipulation."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Calendar;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Calendar);
}
}
default:
{
// Invalid action.
TextWriters.Write(Translate.DoTranslation("Invalid action."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Calendar;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Calendar);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ public override int Execute(CommandParameters parameters, ref string variableVal
if (!int.TryParse(parameters.ArgumentsList[0], out int C))
{
TextWriters.Write(Translate.DoTranslation("The cyan color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}
if (!int.TryParse(parameters.ArgumentsList[1], out int M))
{
TextWriters.Write(Translate.DoTranslation("The magenta color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}
if (!int.TryParse(parameters.ArgumentsList[2], out int Y))
{
TextWriters.Write(Translate.DoTranslation("The yellow color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}

// Do the job
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ public override int Execute(CommandParameters parameters, ref string variableVal
if (!int.TryParse(parameters.ArgumentsList[0], out int C))
{
TextWriters.Write(Translate.DoTranslation("The cyan color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}
if (!int.TryParse(parameters.ArgumentsList[1], out int M))
{
TextWriters.Write(Translate.DoTranslation("The magenta color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}
if (!int.TryParse(parameters.ArgumentsList[2], out int Y))
{
TextWriters.Write(Translate.DoTranslation("The yellow color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}

// Do the job
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ public override int Execute(CommandParameters parameters, ref string variableVal
if (!int.TryParse(parameters.ArgumentsList[0], out int C))
{
TextWriters.Write(Translate.DoTranslation("The cyan color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}
if (!int.TryParse(parameters.ArgumentsList[1], out int M))
{
TextWriters.Write(Translate.DoTranslation("The magenta color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}
if (!int.TryParse(parameters.ArgumentsList[2], out int Y))
{
TextWriters.Write(Translate.DoTranslation("The yellow color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}

// Do the job
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ public override int Execute(CommandParameters parameters, ref string variableVal
if (!int.TryParse(parameters.ArgumentsList[0], out int C))
{
TextWriters.Write(Translate.DoTranslation("The cyan color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}
if (!int.TryParse(parameters.ArgumentsList[1], out int M))
{
TextWriters.Write(Translate.DoTranslation("The magenta color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}
if (!int.TryParse(parameters.ArgumentsList[2], out int Y))
{
TextWriters.Write(Translate.DoTranslation("The yellow color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}

// Do the job
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ public override int Execute(CommandParameters parameters, ref string variableVal
if (!int.TryParse(parameters.ArgumentsList[0], out int C))
{
TextWriters.Write(Translate.DoTranslation("The cyan color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}
if (!int.TryParse(parameters.ArgumentsList[1], out int M))
{
TextWriters.Write(Translate.DoTranslation("The magenta color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}
if (!int.TryParse(parameters.ArgumentsList[2], out int Y))
{
TextWriters.Write(Translate.DoTranslation("The yellow color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}

// Do the job
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ public override int Execute(CommandParameters parameters, ref string variableVal
if (!int.TryParse(parameters.ArgumentsList[0], out int C))
{
TextWriters.Write(Translate.DoTranslation("The cyan color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}
if (!int.TryParse(parameters.ArgumentsList[1], out int M))
{
TextWriters.Write(Translate.DoTranslation("The magenta color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}
if (!int.TryParse(parameters.ArgumentsList[2], out int Y))
{
TextWriters.Write(Translate.DoTranslation("The yellow color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}

// Do the job
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ public override int Execute(CommandParameters parameters, ref string variableVal
if (!int.TryParse(parameters.ArgumentsList[0], out int C))
{
TextWriters.Write(Translate.DoTranslation("The cyan color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}
if (!int.TryParse(parameters.ArgumentsList[1], out int M))
{
TextWriters.Write(Translate.DoTranslation("The magenta color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}
if (!int.TryParse(parameters.ArgumentsList[2], out int Y))
{
TextWriters.Write(Translate.DoTranslation("The yellow color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}

// Do the job
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ public override int Execute(CommandParameters parameters, ref string variableVal
if (!int.TryParse(parameters.ArgumentsList[0], out int C))
{
TextWriters.Write(Translate.DoTranslation("The cyan color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}
if (!int.TryParse(parameters.ArgumentsList[1], out int M))
{
TextWriters.Write(Translate.DoTranslation("The magenta color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}
if (!int.TryParse(parameters.ArgumentsList[2], out int Y))
{
TextWriters.Write(Translate.DoTranslation("The yellow color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}

// Do the job
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ public override int Execute(CommandParameters parameters, ref string variableVal
if (!int.TryParse(parameters.ArgumentsList[0], out int C))
{
TextWriters.Write(Translate.DoTranslation("The cyan color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}
if (!int.TryParse(parameters.ArgumentsList[1], out int M))
{
TextWriters.Write(Translate.DoTranslation("The magenta color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}
if (!int.TryParse(parameters.ArgumentsList[2], out int Y))
{
TextWriters.Write(Translate.DoTranslation("The yellow color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}

// Do the job
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ public override int Execute(CommandParameters parameters, ref string variableVal
if (!int.TryParse(parameters.ArgumentsList[0], out int C))
{
TextWriters.Write(Translate.DoTranslation("The cyan color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}
if (!int.TryParse(parameters.ArgumentsList[1], out int M))
{
TextWriters.Write(Translate.DoTranslation("The magenta color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}
if (!int.TryParse(parameters.ArgumentsList[2], out int Y))
{
TextWriters.Write(Translate.DoTranslation("The yellow color level must be numeric."), true, KernelColorType.Error);
return 10000 + (int)KernelExceptionType.Color;
return KernelExceptionTools.GetErrorCode(KernelExceptionType.Color);
}

// Do the job
Expand Down
Loading

0 comments on commit 9192a22

Please sign in to comment.