better error message in case that a mime type cannot be found.

see also http://forum.yacy-websuche.de/viewtopic.php?f=6&t=132&p=587#p587

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3984 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 18 years ago
parent d477773fa3
commit 6071668c3b

@ -159,8 +159,8 @@ implements Parser {
}
// to avoid loops we have to test if the mimetype has changed ...
if (this.getSupportedMimeTypes().containsKey(mimeType)) throw new ParserException("Unable to detect mimetype of resource.",location);
if (orgMimeType.equals(mimeType)) throw new ParserException("Unable to detect mimetype of resource.",location);
if (this.getSupportedMimeTypes().containsKey(mimeType)) throw new ParserException("Unable to detect mimetype of resource (1).",location);
if (orgMimeType.equals(mimeType)) throw new ParserException("Unable to detect mimetype of resource (2).",location);
// check for interruption
checkInterruption();
@ -169,9 +169,9 @@ implements Parser {
plasmaParser theParser = new plasmaParser();
return theParser.parseSource(location,mimeType,charset,sourceFile);
}
throw new ParserException("Unable to detect mimetype of resource.",location);
throw new ParserException("Unable to detect mimetype of resource (3).",location);
} catch (MagicMatchNotFoundException e) {
throw new ParserException("Unable to detect mimetype of resource.",location);
throw new ParserException("Unable to detect mimetype of resource (4).",location);
} catch (Exception e) {
if (e instanceof InterruptedException) throw (InterruptedException) e;
if (e instanceof ParserException) throw (ParserException) e;

Loading…
Cancel
Save