Skip to content

Commit fad0bef

Browse files
committed
Fixed a few database issues
1 parent 3185c84 commit fad0bef

3 files changed

Lines changed: 10 additions & 11 deletions

File tree

dependency-reduced-pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>com.github.smuddgge</groupId>
55
<artifactId>Leaf</artifactId>
66
<name>Leaf</name>
7-
<version>5.2.0</version>
7+
<version>5.2.1</version>
88
<description>A velocity utility plugin</description>
99
<build>
1010
<resources>

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.github.smuddgge</groupId>
88
<artifactId>Leaf</artifactId>
9-
<version>5.2.0</version>
9+
<version>5.2.1</version>
1010
<packaging>jar</packaging>
1111

1212
<name>Leaf</name>
@@ -97,7 +97,7 @@
9797
<dependency>
9898
<groupId>com.github.smuddgge</groupId>
9999
<artifactId>SquishyDatabase</artifactId>
100-
<version>4.0.0</version>
100+
<version>4.1.0</version>
101101
</dependency>
102102

103103
<!-- Configuration API -->

src/main/java/com/github/smuddgge/leaf/Leaf.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
@Plugin(
5454
id = "leaf",
5555
name = "Leaf",
56-
version = "5.2.0",
56+
version = "5.2.1",
5757
description = "A velocity utility plugin",
5858
authors = {"Smudge"}
5959
)
@@ -353,12 +353,6 @@ public static boolean isDatabaseDisabled() {
353353
*/
354354
public static void setupDatabase(File folder) {
355355

356-
try {
357-
Class.forName("com.mysql.jdbc.Driver");
358-
} catch (ClassNotFoundException e) {
359-
throw new RuntimeException(e);
360-
}
361-
362356
// Set up the database.
363357
if (!ConfigDatabase.get().getBoolean("enabled", true)) {
364358
Leaf.database = null;
@@ -373,8 +367,13 @@ public static void setupDatabase(File folder) {
373367
).build();
374368

375369
} catch (Exception exception) {
376-
exception.printStackTrace();
370+
Console.warn("Unable to create a connection to the database.");
371+
Console.warn("- If you are using mysql make sure the connection string is address:port");
372+
Console.warn("- Ensure you have filled the correct values in the database.yml config");
373+
Console.warn("&7");
377374
Console.warn("Connection String : " + ConfigDatabase.get().getString("connection_string"));
375+
Console.warn("&7");
376+
exception.printStackTrace();
378377
}
379378

380379
if (ConfigDatabase.isDebugMode()) {

0 commit comments

Comments
 (0)