From 7dcac918ec92227c64e80e24056928142fec8258 Mon Sep 17 00:00:00 2001 From: k0rd Date: Fri, 20 Jan 2012 18:45:53 -0500 Subject: [PATCH] Added a more descriptive error message when database dlls are missing. --- TShockAPI/DB/BanManager.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/TShockAPI/DB/BanManager.cs b/TShockAPI/DB/BanManager.cs index 46d4489c..5afa69f9 100644 --- a/TShockAPI/DB/BanManager.cs +++ b/TShockAPI/DB/BanManager.cs @@ -39,7 +39,15 @@ namespace TShockAPI.DB db.GetSqlType() == SqlType.Sqlite ? (IQueryBuilder) new SqliteQueryCreator() : new MysqlQueryCreator()); + try{ creator.EnsureExists(table); + } + catch (DllNotFoundException ex) +{ +System.Console.WriteLine("Possible problem with your database - is Sqlite3.dll present?"); +throw new Exception("Could not find a database library (probably Sqlite3.dll)"); +} + } public Ban GetBanByIp(string ip) @@ -145,4 +153,4 @@ namespace TShockAPI.DB Reason = string.Empty; } } -} \ No newline at end of file +}