Skip to content

Commit

Permalink
better error message in case that a mime type cannot be found.
Browse files Browse the repository at this point in the history
  • Loading branch information
orbiter committed Jul 16, 2007
1 parent d477773 commit 6071668
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/de/anomic/plasma/parser/mimeType/mimeTypeParser.java
Expand Up @@ -159,8 +159,8 @@ public plasmaParserDocument parse(URL location, String mimeType, String charset,
}

// 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();
Expand All @@ -169,9 +169,9 @@ public plasmaParserDocument parse(URL location, String mimeType, String charset,
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;
Expand Down

0 comments on commit 6071668

Please sign in to comment.