runelite-client: Log uncaught exceptions

Previously exceptions would be printed to stderr, and not show in log files.

This also adds a case for AbstractMethodError because it almost always means the injector needs to be re-ran.
This commit is contained in:
Max Weber
2018-05-06 01:00:17 -06:00
parent 185660fff4
commit d1d93f05e0

View File

@@ -154,6 +154,15 @@ public class RuneLite
logger.setLevel(Level.DEBUG);
}
Thread.setDefaultUncaughtExceptionHandler((thread, throwable) ->
{
log.error("Uncaught exception:", throwable);
if (throwable instanceof AbstractMethodError)
{
log.error("Classes are out of date; Build with maven again.");
}
});
setInjector(Guice.createInjector(new RuneLiteModule()));
injector.getInstance(RuneLite.class).start(getOptions().valueOf(updateMode));
}