--- /dev/null
+package org.open_ils.idl;
+
+public class IDLException extends Exception {
+ public IDLException(String info) {
+ super(info);
+ }
+ public IDLException(String info, Throwable cause) {
+ super(info, cause);
+ }
+}
/**
* Parses the IDL XML
*/
- public void parse() throws IOException {
+ public void parse() throws IOException, IDLException {
try {
XMLInputFactory factory = XMLInputFactory.newInstance();
}
} catch(javax.xml.stream.XMLStreamException se) {
- /* throw local exception */
+ throw new IDLException("Error parsing IDL XML", se);
}
}
}
}
- public void handleEndElement(XMLStreamReader reader) {
+ public void handleEndElement(XMLStreamReader reader) throws IDLException {
if(!OILS_NS_BASE.equals(reader.getNamespaceURI())) return;
String localpart = reader.getLocalName();
for(Iterator itr = fields.keySet().iterator(); itr.hasNext(); ) {
String key = (String) itr.next();
IDLField field = (IDLField) fields.get(key);
- fieldNames[ field.getArrayPos() ] = field.getName();
+ try {
+ fieldNames[ field.getArrayPos() ] = field.getName();
+ } catch(ArrayIndexOutOfBoundsException E) {
+ String msg = "class="+current.getIDLClass()+";field="+key+
+ ";fieldcount="+fields.size()+";currentpos="+field.getArrayPos();
+ throw new IDLException(msg, E);
+ }
}
OSRFRegistry.registerObject(