From 9922ec389c06a7acd92060e0580ad6554ff41bce Mon Sep 17 00:00:00 2001 From: Konloch Date: Fri, 27 Sep 2024 03:58:06 -0600 Subject: [PATCH] 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 --- .../resources/classcontainer/ClassFileContainer.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/classcontainer/ClassFileContainer.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/classcontainer/ClassFileContainer.java index bc000116..3e8c4bbb 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/classcontainer/ClassFileContainer.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/classcontainer/ClassFileContainer.java @@ -60,15 +60,15 @@ public class ClassFileContainer 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()