Log errors in client.init, and capture with sentry if rsps isn't on (#1985)

This commit is contained in:
Lucwousin
2019-11-09 19:27:35 +01:00
committed by Ganom
parent da948b6bf7
commit 06fff6654d

View File

@@ -24,6 +24,7 @@
*/ */
package net.runelite.client.ui; package net.runelite.client.ui;
import io.sentry.Sentry;
import java.applet.Applet; import java.applet.Applet;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
@@ -60,11 +61,22 @@ final class ClientPanel extends JPanel
} }
catch (Exception e) catch (Exception e)
{ {
String message = "Detected a bad codebase. Resetting...\n" if (RuneLite.allowPrivateServer)
+ "Please restart client.\n"; {
JOptionPane.showMessageDialog(new JFrame(), message, "Bad Codebase", String message = "Detected a bad codebase. Resetting...\n"
JOptionPane.ERROR_MESSAGE); + "Please restart client.\n";
StringFileUtils.writeStringToFile(RuneLite.RUNELITE_DIR + "/codebase", "http://127.0.0.1/"); JOptionPane.showMessageDialog(new JFrame(), message, "Bad Codebase",
JOptionPane.ERROR_MESSAGE);
StringFileUtils.writeStringToFile(RuneLite.RUNELITE_DIR + "/codebase", "http://127.0.0.1/");
}
else
{
JOptionPane.showMessageDialog(new JFrame(), "Error loading Oldschool RuneScape!", "Error",
JOptionPane.ERROR_MESSAGE);
Sentry.capture(e);
}
((Client) client).getLogger().error(null, e);
System.exit(0); System.exit(0);
} }
client.start(); client.start();