Continue Decompiling On Any Parsing Errors (Except IO)
More of a pre-caution - if parsing fails we should still attempt to display the decompiled code. I've encountered a few errors and manually added them in, but I'm worried I missed one. To fix that I figure we just catch everything that isn't an IO Error. IO-Errors are probably user related (lack of space, insufficient permissions, etc) - So these errors we should forward to the user, the rest we can silence for developer eyes
This commit is contained in:
parent
89a26407f8
commit
9922ec389c
|
@ -60,15 +60,15 @@ public class ClassFileContainer
|
||||||
CompilationUnit compilationUnit = StaticJavaParser.parse(this.content);
|
CompilationUnit compilationUnit = StaticJavaParser.parse(this.content);
|
||||||
compilationUnit.accept(new MyVoidVisitor(this, compilationUnit), null);
|
compilationUnit.accept(new MyVoidVisitor(this, compilationUnit), null);
|
||||||
}
|
}
|
||||||
catch (java.util.NoSuchElementException | java.lang.ClassCastException | UnsolvedSymbolException | ParseProblemException e)
|
|
||||||
{
|
|
||||||
System.err.println("Parsing error!");
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
catch (IOException e)
|
catch (IOException e)
|
||||||
{
|
{
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
System.err.println("Parsing error: " + className);
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName()
|
public String getName()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user