catch exceptions that occur during the parsing (stringindexoutofbound etc) and

print stack trace to stdout but don't stop parsing the app.
This commit is contained in:
stefanp 2003-03-03 12:30:17 +00:00
parent 26529df21a
commit ccb89fbfd9

View file

@ -84,20 +84,25 @@ public class DocPrototype extends DocDirElement {
File f = new File (location.getAbsolutePath (), arr[i]);
if (f.isDirectory ())
continue;
if (arr[i].endsWith (".skin")) {
addChild (DocSkin.newInstance (f, this));
} else if (arr[i].endsWith (".properties")) {
continue;
} else if (arr[i].endsWith (".hac")) {
addChild (DocFunction.newAction (f, this));
} else if (arr[i].endsWith (".hsp")) {
addChild (DocFunction.newTemplate (f, this));
} else if (arr[i].endsWith (".js")) {
DocElement[] elements = DocFunction.newFunctions (f, this);
for (int j=0; j<elements.length; j++) {
addChild (elements[j]);
}
}
try {
if (arr[i].endsWith (".skin")) {
addChild (DocSkin.newInstance (f, this));
} else if (arr[i].endsWith (".properties")) {
continue;
} else if (arr[i].endsWith (".hac")) {
addChild (DocFunction.newAction (f, this));
} else if (arr[i].endsWith (".hsp")) {
addChild (DocFunction.newTemplate (f, this));
} else if (arr[i].endsWith (".js")) {
DocElement[] elements = DocFunction.newFunctions (f, this);
for (int j=0; j<elements.length; j++) {
addChild (elements[j]);
}
}
} catch (Exception ex) {
System.out.println ("couldn't parse file " + f.getAbsolutePath () + ": " + ex.toString ());
ex.printStackTrace ();
}
}
}