Better Compiler Error Handling

This commit is contained in:
Konloch 2021-07-06 23:11:49 -07:00
parent 9af03cb465
commit f3c7c1881a

View file

@ -79,20 +79,23 @@ public class ResourceViewPanel
nl + "Keep in mind most decompilers cannot produce compilable classes" + nl + "Keep in mind most decompilers cannot produce compilable classes" +
nl + nl); nl + nl);
try
{
String text = textArea.getText(); String text = textArea.getText();
byte[] compiledClass = compileMode.getCompiler().compile(text, viewer.cn.name); byte[] compiledClass = compileMode.getCompiler().compile(text, viewer.cn.name);
if (compiledClass != null) if (compiledClass != null)
{ {
try {
ClassNode newNode = JarUtils.getNode(compiledClass); ClassNode newNode = JarUtils.getNode(compiledClass);
BytecodeViewer.updateNode(viewer.cn, newNode); BytecodeViewer.updateNode(viewer.cn, newNode);
errConsole.finished(); errConsole.finished();
return true; return true;
} catch (Exception e) {
e.printStackTrace();
} }
} }
catch (Exception e)
{
e.printStackTrace();
}
errConsole.pretty(); errConsole.pretty();
errConsole.setVisible(true); errConsole.setVisible(true);