From c1ad97d26f75937248beafdfaf1901ca5de92478 Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 2 Jul 2024 10:22:00 +0200 Subject: [PATCH] Fixes exception in app-command creation --- Tools/BiblioTech/CommandHandler.cs | 1 + Tools/BiblioTech/Commands/AdminCommand.cs | 2 +- Tools/BiblioTech/Options/CommandOption.cs | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Tools/BiblioTech/CommandHandler.cs b/Tools/BiblioTech/CommandHandler.cs index c2d4f14..ed1fee2 100644 --- a/Tools/BiblioTech/CommandHandler.cs +++ b/Tools/BiblioTech/CommandHandler.cs @@ -70,6 +70,7 @@ namespace BiblioTech { var json = JsonConvert.SerializeObject(exception.Errors, Formatting.Indented); log.Error(json); + throw exception; } log.Log("Initialized."); } diff --git a/Tools/BiblioTech/Commands/AdminCommand.cs b/Tools/BiblioTech/Commands/AdminCommand.cs index d80326f..45b3fc2 100644 --- a/Tools/BiblioTech/Commands/AdminCommand.cs +++ b/Tools/BiblioTech/Commands/AdminCommand.cs @@ -224,7 +224,7 @@ namespace BiblioTech.Commands public LogReplaceCommand(CustomReplacement replacement) : base(name: "logreplace", - description: "Replaces all occurances of 'from' with 'to' in ChainEvent messages. Leave 'to' empty to remove a replacement.") + description: "Replaces all 'from' with 'to' in ChainEvents.") { this.replacement = replacement; } diff --git a/Tools/BiblioTech/Options/CommandOption.cs b/Tools/BiblioTech/Options/CommandOption.cs index 7784801..7d7afe1 100644 --- a/Tools/BiblioTech/Options/CommandOption.cs +++ b/Tools/BiblioTech/Options/CommandOption.cs @@ -10,6 +10,8 @@ namespace BiblioTech.Options Description = description; Type = type; IsRequired = isRequired; + + if (Description.Length > 100) throw new Exception("Description for option " + name + " too long!"); } public string Name { get; }