Cleanup FernFlower Exceptions
This commit is contained in:
parent
ab2ce702d9
commit
8d947b6748
|
@ -24,6 +24,7 @@ import the.bytecode.club.bytecodeviewer.BytecodeViewer;
|
||||||
import the.bytecode.club.bytecodeviewer.api.ExceptionUI;
|
import the.bytecode.club.bytecodeviewer.api.ExceptionUI;
|
||||||
import the.bytecode.club.bytecodeviewer.decompilers.AbstractDecompiler;
|
import the.bytecode.club.bytecodeviewer.decompilers.AbstractDecompiler;
|
||||||
import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings;
|
import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings;
|
||||||
|
import the.bytecode.club.bytecodeviewer.util.ExceptionUtils;
|
||||||
import the.bytecode.club.bytecodeviewer.util.TempFile;
|
import the.bytecode.club.bytecodeviewer.util.TempFile;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
@ -73,7 +74,7 @@ public class FernFlowerDecompiler extends AbstractDecompiler
|
||||||
public String decompileClassNode(ClassNode cn, byte[] bytes)
|
public String decompileClassNode(ClassNode cn, byte[] bytes)
|
||||||
{
|
{
|
||||||
TempFile tempFile = null;
|
TempFile tempFile = null;
|
||||||
String exception = "This decompiler didn't throw an exception - this is probably a BCV logical bug";
|
String exception;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -129,15 +130,11 @@ public class FernFlowerDecompiler extends AbstractDecompiler
|
||||||
if (tempOutputJavaFile.exists())
|
if (tempOutputJavaFile.exists())
|
||||||
return DiskReader.loadAsString(tempOutputJavaFile.getAbsolutePath());
|
return DiskReader.loadAsString(tempOutputJavaFile.getAbsolutePath());
|
||||||
else
|
else
|
||||||
exception = "BCV Error: " + tempOutputJavaFile.getAbsolutePath() + " does not exist.";
|
exception = FERNFLOWER + " " + ERROR + "! " + tempOutputJavaFile.getAbsolutePath() + " does not exist.";
|
||||||
}
|
}
|
||||||
catch (Throwable e)
|
catch (Throwable e)
|
||||||
{
|
{
|
||||||
StringWriter exceptionWriter = new StringWriter();
|
exception = NL + NL + ExceptionUtils.exceptionToString(e);
|
||||||
e.printStackTrace(new PrintWriter(exceptionWriter));
|
|
||||||
e.printStackTrace();
|
|
||||||
|
|
||||||
exception += NL + NL + exceptionWriter;
|
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user