try to remove hung swf parser from queue

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6090 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
lotus 16 years ago
parent fc69a76197
commit c695c7f512

@ -72,6 +72,8 @@ public class swfParser extends AbstractParser implements Parser {
*/
public plasmaParserDocument parse(final yacyURL location, final String mimeType, final String charset, final InputStream source) throws ParserException, InterruptedException {
plasmaParserDocument theDoc = null;
try {
final SWF2HTML swf2html = new SWF2HTML();
String contents = "";
@ -109,7 +111,7 @@ public class swfParser extends AbstractParser implements Parser {
}
// As the result of parsing this function must return a plasmaParserDocument object
final plasmaParserDocument theDoc = new plasmaParserDocument(
theDoc = new plasmaParserDocument(
location, // url of the source document
mimeType, // the documents mime type
"UTF-8", // charset of the document text
@ -134,6 +136,13 @@ public class swfParser extends AbstractParser implements Parser {
final String errorMsg = "Unable to parse the swf document '" + location + "':" + e.getMessage();
this.theLogger.logSevere(errorMsg);
throw new ParserException(errorMsg, location);
} finally {
if (theDoc == null) {
// if an unexpected error occures just log the error and raise a new ParserException
final String errorMsg = "Unable to parse the swf document '" + location + "': possibly out of memory";
this.theLogger.logSevere(errorMsg);
throw new ParserException(errorMsg, location);
}
}
}

Loading…
Cancel
Save