Disables plugin on failing to connect to sql

This commit is contained in:
space_fountain
2014-01-01 00:35:25 -05:00
parent 63be477135
commit 4b3cd4a46f

View File

@@ -1,5 +1,7 @@
package isaac.bastion.storage;
import isaac.bastion.Bastion;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -13,6 +15,8 @@ import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.Bukkit;
/**
* MySql database
*
@@ -76,7 +80,8 @@ public class Database {
this.logger.log(Level.INFO, "Connected to database!");
return true;
} catch (SQLException ex) { //Error handling below:
this.logger.log(Level.SEVERE, "Could not connnect to the database!", ex);
this.logger.log(Level.SEVERE, "Could not connnect to the database!");
Bukkit.getPluginManager().disablePlugin(Bastion.getPlugin());
return false;
}
}