Skip to content

Commit

Permalink
Continue Decompiling On Any Parsing Errors (Except IO)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Konloch committed Sep 27, 2024
1 parent 89a2640 commit 9922ec3
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ public void parse()
CompilationUnit compilationUnit = StaticJavaParser.parse(this.content);
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)
{
throw new RuntimeException(e);
}
catch (Exception e)
{
System.err.println("Parsing error: " + className);
e.printStackTrace();
}
}

public String getName()
Expand Down

0 comments on commit 9922ec3

Please sign in to comment.