Skip to content

Commit

Permalink
try to remove hung swf parser from queue
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6090 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
lotus committed Jun 17, 2009
1 parent fc69a76 commit c695c7f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion source/de/anomic/plasma/parser/swf/swfParser.java
Expand Up @@ -72,6 +72,8 @@ public Hashtable<String, String> getSupportedMimeTypes() {
*/
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 = "";
Expand Down Expand Up @@ -109,7 +111,7 @@ public plasmaParserDocument parse(final yacyURL location, final String mimeType,
}

// 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
Expand All @@ -134,6 +136,13 @@ public plasmaParserDocument parse(final yacyURL location, final String mimeType,
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);
}
}
}

Expand Down

0 comments on commit c695c7f

Please sign in to comment.