1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-23 03:15:48 +02:00

Fix exception messages

This commit is contained in:
chylex 2022-02-05 22:31:30 +01:00
parent ad30021d6d
commit c4aa62fc3a
Signed by: chylex
GPG Key ID: 4DE42C8F19A80548
5 changed files with 10 additions and 10 deletions
lib
TweetLib.Browser.CEF/Logic
TweetLib.Core
TweetLib.Utils/IO

View File

@ -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!");
}
}
}

View File

@ -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.");
}
}

View File

@ -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.");
}
}

View File

@ -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;

View File

@ -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;