Silence Exceptions

This commit is contained in:
Konloch 2021-06-29 11:24:47 -07:00
parent 1302a9c271
commit 7dd66d675c
2 changed files with 17 additions and 3 deletions

View file

@ -33,6 +33,8 @@ public class Configuration
public static boolean pingback = false;
public static boolean deleteForeignLibraries = true;
public static boolean canExit = false;
public static int silenceExceptionGUI = 0;
public static int pauseExceptionGUI = 0;
public static boolean verifyCorruptedStateOnBoot = false; //eventually may be a setting

View file

@ -8,7 +8,8 @@ import java.io.StringWriter;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
import the.bytecode.club.bytecodeviewer.Configuration;
import the.bytecode.club.bytecodeviewer.Resources;
import static the.bytecode.club.bytecodeviewer.Constants.*;
@ -71,8 +72,19 @@ public class ExceptionUI extends JFrame {
setup(e, author);
}
private void setup(Throwable e, String author) {
private void setup(Throwable e, String author)
{
//exceptions are completely hidden
if(Configuration.silenceExceptionGUI > 0)
return;
//exception GUI is disabled but printstack is still enabled
if(Configuration.pauseExceptionGUI > 0)
{
e.printStackTrace();
return;
}
this.setIconImages(Resources.iconList);
setSize(new Dimension(600, 400));
setTitle("Bytecode Viewer " + VERSION + " - Stack Trace - Send this to " + author);