Skip to content

Commit

Permalink
improve SQL exceptions to be more easily debuggable
Browse files Browse the repository at this point in the history
  • Loading branch information
nossr50 committed Jan 15, 2024
1 parent 009d809 commit dda5b45
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ public final class SQLDatabaseManager implements DatabaseManager {
loadPool = new DataSource(poolProperties);

checkStructure();

}

@NotNull
Expand Down Expand Up @@ -1272,13 +1271,7 @@ private PlayerProfile loadFromResult(String playerName, ResultSet result) throws
}

private void printErrors(SQLException ex) {
if (debug || h2) {
ex.printStackTrace();
} else {
for (StackTraceElement element : ex.getStackTrace()) {
logger.severe("Location: " + element.getClassName() + " " + element.getMethodName() + " " + element.getLineNumber());
}
}
ex.printStackTrace();

// logger.severe("SQLException: " + ex.getMessage());
logger.severe("SQLState: " + ex.getSQLState());
Expand Down

0 comments on commit dda5b45

Please sign in to comment.