Cleanup: Properly log errors and remove unnecessary early return

This commit is contained in:
Phoenix616 2023-03-01 17:49:59 +01:00
parent ada8cf3ae8
commit e6a2d2f1c5
No known key found for this signature in database
GPG Key ID: 40E2321E71738EB0
2 changed files with 4 additions and 6 deletions

View File

@ -28,8 +28,6 @@ public class Migrations {
public static int migrate(int currentVersion) {
if (currentVersion != CURRENT_DATABASE_VERSION) {
ChestShop.getBukkitLogger().info("Updating database...");
} else {
return CURRENT_DATABASE_VERSION;
}
switch (currentVersion) {
@ -67,7 +65,7 @@ public class Migrations {
accounts.executeRaw("ALTER TABLE `accounts` ADD COLUMN lastSeenName VARCHAR");
return true;
} catch (SQLException e) {
e.printStackTrace();
ChestShop.getBukkitLogger().log(Level.SEVERE, "Error while migrating database to v2", e);
return false;
}
}
@ -122,7 +120,7 @@ public class Migrations {
return true;
} catch (SQLException e) {
e.printStackTrace();
ChestShop.getBukkitLogger().log(Level.SEVERE, "Error while migrating database to v3", e);
return false;
}
}
@ -145,7 +143,7 @@ public class Migrations {
return true;
} catch (SQLException e) {
e.printStackTrace();
ChestShop.getBukkitLogger().log(Level.SEVERE, "Error while migrating database to v4", e);
return false;
}
}

View File

@ -355,7 +355,7 @@ public class NameManager implements Listener {
}
}
} catch (SQLException e) {
e.printStackTrace();
ChestShop.getBukkitLogger().log(Level.SEVERE, "Error while trying to setup accounts", e);
}
}