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:
parent
ad30021d6d
commit
c4aa62fc3a
lib
TweetLib.Browser.CEF/Logic
TweetLib.Core
TweetLib.Utils/IO
@ -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!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user