From c4aa62fc3a799ae27b6e04b8ad1bb874f8480189 Mon Sep 17 00:00:00 2001
From: chylex <contact@chylex.com>
Date: Sat, 5 Feb 2022 22:31:30 +0100
Subject: [PATCH] Fix exception messages

---
 lib/TweetLib.Browser.CEF/Logic/ResponseFilterLogic.cs | 2 +-
 lib/TweetLib.Core/App.cs                              | 6 +++---
 lib/TweetLib.Core/Features/Plugins/Plugin.cs          | 8 ++++----
 lib/TweetLib.Core/Features/Plugins/PluginLoader.cs    | 2 +-
 lib/TweetLib.Utils/IO/CombinedFileStream.cs           | 2 +-
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/lib/TweetLib.Browser.CEF/Logic/ResponseFilterLogic.cs b/lib/TweetLib.Browser.CEF/Logic/ResponseFilterLogic.cs
index 0f075a41..68bb8180 100644
--- a/lib/TweetLib.Browser.CEF/Logic/ResponseFilterLogic.cs
+++ b/lib/TweetLib.Browser.CEF/Logic/ResponseFilterLogic.cs
@@ -66,7 +66,7 @@ public FilterStatus Filter(Stream? dataIn, out long dataInRead, Stream dataOut,
 				}
 			}
 			else {
-				throw new InvalidOperationException("This resource filter cannot be reused.");
+				throw new InvalidOperationException("This resource filter cannot be reused!");
 			}
 		}
 	}
diff --git a/lib/TweetLib.Core/App.cs b/lib/TweetLib.Core/App.cs
index 9eeec29b..d67961a4 100644
--- a/lib/TweetLib.Core/App.cs
+++ b/lib/TweetLib.Core/App.cs
@@ -91,20 +91,20 @@ public static void Close() {
 
 		// Setup
 
-		private static AppBuilder Builder => AppBuilder.Instance ?? throw new InvalidOperationException("App is initializing too early");
+		private static AppBuilder Builder => AppBuilder.Instance ?? throw new InvalidOperationException("App is initializing too early!");
 
 		private static bool isInitialized = false;
 
 		internal static void Initialize() {
 			if (isInitialized) {
-				throw new InvalidOperationException("App is already initialized");
+				throw new InvalidOperationException("App is already initialized!");
 			}
 
 			isInitialized = true;
 		}
 
 		private static T Validate<T>(T? obj, string name) where T : class {
-			return obj ?? throw new InvalidOperationException("Missing property " + name + " on the provided App");
+			return obj ?? throw new InvalidOperationException("Missing property " + name + " on the provided App.");
 		}
 	}
 
diff --git a/lib/TweetLib.Core/Features/Plugins/Plugin.cs b/lib/TweetLib.Core/Features/Plugins/Plugin.cs
index d60f72f3..7562ba6f 100644
--- a/lib/TweetLib.Core/Features/Plugins/Plugin.cs
+++ b/lib/TweetLib.Core/Features/Plugins/Plugin.cs
@@ -132,19 +132,19 @@ public Plugin BuildAndSetup() {
 				Plugin plugin = new Plugin(group, identifier, pathRoot, pathData, this);
 
 				if (plugin.Name.Length == 0) {
-					throw new InvalidOperationException("Plugin is missing a name in the .meta file");
+					throw new InvalidOperationException("Plugin is missing a name in the .meta file.");
 				}
 
 				if (!PluginEnvironments.All.Any(plugin.HasEnvironment)) {
-					throw new InvalidOperationException("Plugin has no script files");
+					throw new InvalidOperationException("Plugin has no script files.");
 				}
 
 				if (plugin.Group == PluginGroup.Official) {
 					if (plugin.RequiredVersion != AppVersion) {
-						throw new InvalidOperationException("Plugin is not supported in this version of TweetDuck, this may indicate a failed update or an unsupported plugin that was not removed automatically");
+						throw new InvalidOperationException("Plugin is not supported in this version of TweetDuck, this may indicate a failed update or an unsupported plugin that was not removed automatically.");
 					}
 					else if (!string.IsNullOrEmpty(plugin.Version)) {
-						throw new InvalidOperationException("Official plugins cannot have a version identifier");
+						throw new InvalidOperationException("Official plugins cannot have a version identifier.");
 					}
 				}
 
diff --git a/lib/TweetLib.Core/Features/Plugins/PluginLoader.cs b/lib/TweetLib.Core/Features/Plugins/PluginLoader.cs
index e3421e0b..71401462 100644
--- a/lib/TweetLib.Core/Features/Plugins/PluginLoader.cs
+++ b/lib/TweetLib.Core/Features/Plugins/PluginLoader.cs
@@ -48,7 +48,7 @@ public static Plugin FromFolder(string name, string pathRoot, string pathData, P
 			string metaFile = Path.Combine(pathRoot, ".meta");
 
 			if (!File.Exists(metaFile)) {
-				throw new ArgumentException("Plugin is missing a .meta file");
+				throw new ArgumentException("Plugin is missing a .meta file.");
 			}
 
 			string? currentTag = null;
diff --git a/lib/TweetLib.Utils/IO/CombinedFileStream.cs b/lib/TweetLib.Utils/IO/CombinedFileStream.cs
index 78ac3b23..0e1743a0 100644
--- a/lib/TweetLib.Utils/IO/CombinedFileStream.cs
+++ b/lib/TweetLib.Utils/IO/CombinedFileStream.cs
@@ -11,7 +11,7 @@ public sealed class CombinedFileStream : IDisposable {
 
 		private static string ValidateIdentifier(string identifier) {
 			if (identifier.IndexOf(KeySeparator) != -1) {
-				throw new ArgumentException("Identifier must not contain the '|' character");
+				throw new ArgumentException("Identifier must not contain the '|' character!");
 			}
 
 			return identifier;