Skip unparsable documets wihout exception

cusax-fix
Damian Minkov 20 years ago
parent fc8a86749e
commit 40efeefb05

@ -227,8 +227,11 @@ protected Document getDocumentForFile(String filename)
retVal = builder.parse(file);
} catch (Exception e)
{
throw new RuntimeException("Error occured while "
+ "parsing XML document.", e);
// throw new RuntimeException("Error occured while "
// + "parsing XML document.", e);
// log.error("Error occured while parsing XML document.", e);
log.error("Error occured while parsing XML document.");
return null;
}
// Cache the loaded document for reuse if configured

@ -160,6 +160,12 @@ public synchronized QueryResultSet findLast(int count) throws RuntimeException
Document doc = this.historyImpl.
getDocumentForFile( (String) filelist.get(currentFile));
if(doc == null)
{
currentFile--;
continue;
}
// will get nodes and construct a List of nodes
// so we can easyly get sublist of it
List nodes = new ArrayList();
@ -313,6 +319,9 @@ private QueryResultSet find(
Document doc = this.historyImpl.getDocumentForFile(filename);
if(doc == null)
continue;
NodeList nodes = doc.getElementsByTagName("record");
double nodesProgressStep = fileProgressStep;

@ -176,6 +176,13 @@ private void createNewDoc(Date date, boolean loadLastFile)
this.currentFile = file;
loaded = true;
}
// if something happend and file was not loaded
// then we must create new one
if(this.currentDoc == null)
{
loaded = false;
}
}
if (!loaded)

Loading…
Cancel
Save