From d8df50a928ac94e4929aaf6bb7fa4dda5aa46552 Mon Sep 17 00:00:00 2001 From: That-One-Nerd Date: Mon, 24 Apr 2023 17:33:51 -0400 Subject: [PATCH 1/2] Tiny change. --- SrcMod/Shell/LoadingBar.cs | 2 +- SrcMod/Shell/Tools.cs | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/SrcMod/Shell/LoadingBar.cs b/SrcMod/Shell/LoadingBar.cs index f658c8e..b4102e8 100644 --- a/SrcMod/Shell/LoadingBar.cs +++ b/SrcMod/Shell/LoadingBar.cs @@ -1,6 +1,6 @@ namespace SrcMod.Shell; -internal static class LoadingBar +public static class LoadingBar { public static int position = -1; public static int bufferSize = 0; diff --git a/SrcMod/Shell/Tools.cs b/SrcMod/Shell/Tools.cs index ef6cc12..34c63b5 100644 --- a/SrcMod/Shell/Tools.cs +++ b/SrcMod/Shell/Tools.cs @@ -1,8 +1,6 @@ -using System.Text; +namespace SrcMod.Shell; -namespace SrcMod.Shell; - -internal static class Tools +public static class Tools { public static void DisplayWithPages(IEnumerable lines, ConsoleColor? color = null) { From 2dc37cd6accbda656fd2829431a931bd6f62d52b Mon Sep 17 00:00:00 2001 From: That_One_Nerd Date: Tue, 25 Apr 2023 17:19:07 -0400 Subject: [PATCH 2/2] Debug mode gives better errors now (tiny patch) --- SrcMod/Shell/Shell.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/SrcMod/Shell/Shell.cs b/SrcMod/Shell/Shell.cs index 58cd52e..161cfa0 100644 --- a/SrcMod/Shell/Shell.cs +++ b/SrcMod/Shell/Shell.cs @@ -237,24 +237,27 @@ public class Shell void runCommand(object? sender, DoWorkEventArgs e) { -#if RELEASE try { -#endif command.Invoke(args); -#if RELEASE } +#if RELEASE catch (TargetInvocationException ex) { Write($"[ERROR] {ex.InnerException!.Message}", ConsoleColor.Red); if (LoadingBar.Enabled) LoadingBar.End(); } +#endif catch (Exception ex) { +#if RELEASE Write($"[ERROR] {ex.Message}", ConsoleColor.Red); if (LoadingBar.Enabled) LoadingBar.End(); - } +#else + Write($"[ERROR] {ex}", ConsoleColor.Red); + if (LoadingBar.Enabled) LoadingBar.End(); #endif + } } activeCommand = new();