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/Shell.cs b/SrcMod/Shell/Shell.cs index 0629dd8..372d084 100644 --- a/SrcMod/Shell/Shell.cs +++ b/SrcMod/Shell/Shell.cs @@ -239,24 +239,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(); diff --git a/SrcMod/Shell/Tools.cs b/SrcMod/Shell/Tools.cs index c90265d..bd1c219 100644 --- a/SrcMod/Shell/Tools.cs +++ b/SrcMod/Shell/Tools.cs @@ -1,6 +1,6 @@ namespace SrcMod.Shell; -internal static class Tools +public static class Tools { public static JsonSerializer Serializer { get; private set; }