Cleanup: Properly log errors and remove unnecessary early return
This commit is contained in:
parent
ada8cf3ae8
commit
e6a2d2f1c5
|
@ -28,8 +28,6 @@ public class Migrations {
|
||||||
public static int migrate(int currentVersion) {
|
public static int migrate(int currentVersion) {
|
||||||
if (currentVersion != CURRENT_DATABASE_VERSION) {
|
if (currentVersion != CURRENT_DATABASE_VERSION) {
|
||||||
ChestShop.getBukkitLogger().info("Updating database...");
|
ChestShop.getBukkitLogger().info("Updating database...");
|
||||||
} else {
|
|
||||||
return CURRENT_DATABASE_VERSION;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (currentVersion) {
|
switch (currentVersion) {
|
||||||
|
@ -67,7 +65,7 @@ public class Migrations {
|
||||||
accounts.executeRaw("ALTER TABLE `accounts` ADD COLUMN lastSeenName VARCHAR");
|
accounts.executeRaw("ALTER TABLE `accounts` ADD COLUMN lastSeenName VARCHAR");
|
||||||
return true;
|
return true;
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
e.printStackTrace();
|
ChestShop.getBukkitLogger().log(Level.SEVERE, "Error while migrating database to v2", e);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -122,7 +120,7 @@ public class Migrations {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
e.printStackTrace();
|
ChestShop.getBukkitLogger().log(Level.SEVERE, "Error while migrating database to v3", e);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -145,7 +143,7 @@ public class Migrations {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
e.printStackTrace();
|
ChestShop.getBukkitLogger().log(Level.SEVERE, "Error while migrating database to v4", e);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -355,7 +355,7 @@ public class NameManager implements Listener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
e.printStackTrace();
|
ChestShop.getBukkitLogger().log(Level.SEVERE, "Error while trying to setup accounts", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue