ExtremeDemonList/src/errorhandler/ErrorHandler.java
2024-09-08 14:57:19 +02:00

21 lines
460 B
Java

package errorhandler;
import java.io.PrintWriter;
import java.io.StringWriter;
import javax.swing.JOptionPane;
public class ErrorHandler {
public void newError(Throwable e) {
e.printStackTrace();
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
JOptionPane.showMessageDialog(null, sw.toString() + "", e.getMessage(), JOptionPane.ERROR_MESSAGE);
System.exit(-1);
}
}