Replace printStackTrace with logger

This commit is contained in:
GeorgH93 2024-01-18 00:41:53 +01:00
parent e50c92f603
commit 12c0892419
No known key found for this signature in database
GPG Key ID: D1630D37F9E4B3C8
1 changed files with 4 additions and 5 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2023 GeorgH93
* Copyright (C) 2024 GeorgH93
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -236,8 +236,7 @@ public abstract class SQL extends Database
}
catch(SQLException e)
{
plugin.getLogger().warning("Failed to save backpack in database! Error: " + e.getMessage());
e.printStackTrace();
plugin.getLogger().log(Level.SEVERE, "Failed to save backpack in database! Error: {0}", e.getMessage());
writeBackup(name, nameOrUUID, usedSerializer, data);
}
};
@ -289,7 +288,7 @@ public abstract class SQL extends Database
}
catch(SQLException e)
{
e.printStackTrace();
plugin.getLogger().log(Level.SEVERE, "Failed to load backpack! Error: {0}", e.getMessage());
plugin.getServer().getScheduler().runTask(plugin, callback::onFail);
}
});
@ -317,7 +316,7 @@ public abstract class SQL extends Database
}
catch(SQLException e)
{
e.printStackTrace();
plugin.getLogger().log(Level.SEVERE, "Failed to load cooldown! Error: {0}", e.getMessage());
plugin.getServer().getScheduler().runTask(plugin, () -> callback.onResult(0L));
}
});