9
0
mirror of https://github.com/WiIIiam278/HuskSync.git synced 2025-12-23 08:39:19 +00:00

Make initialization exception more obvious, close #47

This commit is contained in:
William
2022-08-21 11:54:51 +01:00
parent 18b96944e9
commit 2690ab3144

View File

@@ -184,7 +184,19 @@ public class BukkitHuskSync extends JavaPlugin implements HuskSync {
CompletableFuture.runAsync(() -> new UpdateChecker(getPluginVersion(), getLoggingAdapter()).logToConsole());
}
} catch (HuskSyncInitializationException exception) {
getLoggingAdapter().log(Level.SEVERE, exception.getMessage());
getLoggingAdapter().log(Level.SEVERE, """
***************************************************
Failed to initialize HuskSync!
***************************************************
The plugin was disabled due to an error. Please check
the logs below for details.
No user data will be synchronised.
***************************************************
Caused by: %error_message%
"""
.replaceAll("%error_message%", exception.getMessage()));
initialized.set(false);
} catch (Exception exception) {
getLoggingAdapter().log(Level.SEVERE, "An unhandled exception occurred initializing HuskSync!", exception);