Skip to content

Commit f15316d

Browse files
committed
couple tweaks for Mode debugging
1 parent 5ff3f66 commit f15316d

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

app/src/processing/app/Base.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,13 +397,18 @@ void rebuildContribModes() {
397397
contribModes.add(new ModeContribution(this, folder, null));
398398
} catch (NoSuchMethodError nsme) {
399399
System.err.println(folder.getName() + " is not compatible with this version of Processing");
400+
if (DEBUG) nsme.printStackTrace();
400401
} catch (NoClassDefFoundError ncdfe) {
401402
System.err.println(folder.getName() + " is not compatible with this version of Processing");
403+
if (DEBUG) ncdfe.printStackTrace();
402404
} catch (InvocationTargetException ite) {
403405
System.err.println(folder.getName() + " could not be loaded and may not compatible with this version of Processing");
406+
if (DEBUG) ite.printStackTrace();
404407
} catch (IgnorableException ig) {
405408
Messages.log(ig.getMessage());
409+
if (DEBUG) ig.printStackTrace();
406410
} catch (Throwable e) {
411+
System.err.println("Could not load Mode from " + folder);
407412
e.printStackTrace();
408413
}
409414
} else {

app/src/processing/app/contrib/ModeContribution.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,11 @@ public boolean equals(Object o) {
137137
return loader.equals(other.loader) && mode.equals(other.getMode());
138138
}
139139

140-
public String initLoader(Base base, String className) throws Exception {
141140

141+
public String initLoader(Base base, String className) throws Exception {
142142
File modeDirectory = new File(folder, getTypeName());
143143
if (modeDirectory.exists()) {
144-
Messages.log("checking mode folder regarding " + className);
144+
Messages.log("checking mode folder regarding class name " + className);
145145
// If no class name specified, search the main <modename>.jar for the
146146
// full name package and mode name.
147147
if (className == null) {
@@ -170,7 +170,7 @@ public String initLoader(Base base, String className) throws Exception {
170170
installedModes.put(m.getClass().getName(), m);
171171
}
172172

173-
for(String modeImport: imports){
173+
for (String modeImport: imports) {
174174
if (installedModes.containsKey(modeImport)) {
175175
Messages.log("Found mode dependency " + modeImport);
176176
File modeFolder = installedModes.get(modeImport).getFolder();
@@ -182,8 +182,9 @@ public String initLoader(Base base, String className) throws Exception {
182182
}
183183
}
184184
} else {
185-
throw new IgnorableException("Dependency mode "+ modeImport + " could not be"
186-
+ " found. Can't load " + className);
185+
throw new IgnorableException("Can't load " + className +
186+
" because the import " + modeImport +
187+
" could not be found. ");
187188
}
188189
}
189190
}

0 commit comments

Comments
 (0)