From ba761aaa298090d0244c6e07a590aae9a47a6487 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Wed, 4 Jun 2014 00:02:57 -0500 Subject: [PATCH] Improved Part API Errors. --- core/api/ApiPart.java | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/core/api/ApiPart.java b/core/api/ApiPart.java index a40740268..25db2945f 100644 --- a/core/api/ApiPart.java +++ b/core/api/ApiPart.java @@ -97,13 +97,20 @@ public class ApiPart implements IPartHelper public ClassNode getReader(String name) throws IOException { - ClassReader cr; - String path = "/" + name.replace( ".", "/" ) + ".class"; - InputStream is = getClass().getResourceAsStream( path ); - cr = new ClassReader( is ); - ClassNode cn = new ClassNode(); - cr.accept( cn, ClassReader.EXPAND_FRAMES ); - return cn; + try + { + ClassReader cr; + String path = "/" + name.replace( ".", "/" ) + ".class"; + InputStream is = getClass().getResourceAsStream( path ); + cr = new ClassReader( is ); + ClassNode cn = new ClassNode(); + cr.accept( cn, ClassReader.EXPAND_FRAMES ); + return cn; + } + catch (Throwable t) + { + throw new RuntimeException( "Error loading " + name, t ); + } } public Class getCombinedInstance(String base) @@ -167,6 +174,7 @@ public class ApiPart implements IPartHelper } catch (Throwable t) { + AELog.warning( "Error loading " + name ); AELog.error( t ); // throw new RuntimeException( t ); }