Skip to content

Commit

Permalink
Catch all exceptions thrown from resolved Source creation (GR-16391).
Browse files Browse the repository at this point in the history
  • Loading branch information
entlicher committed Jul 16, 2020
1 parent 4bae4d9 commit c4437ab
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,14 @@ private Source doResolve(Source source) {
// fallback to a general Source
}
}
if (builder == null) {
String name = uri.getPath() != null ? uri.getPath() : uri.getSchemeSpecificPart();
builder = Source.newBuilder(source.getLanguage(), new InputStreamReader(stream), name).uri(uri);
}
try {
if (builder == null) {
String name = uri.getPath() != null ? uri.getPath() : uri.getSchemeSpecificPart();
builder = Source.newBuilder(source.getLanguage(), new InputStreamReader(stream), name).uri(uri);
}
return builder.cached(false).interactive(source.isInteractive()).internal(source.isInternal()).mimeType(source.getMimeType()).build();
} catch (IOException ex) {
} catch (IOException | SecurityException e) {
env.getLogger("").warning(String.format("Failed to resolve %s: %s%s", source.getURI(), e.getLocalizedMessage(), System.lineSeparator()));
return null;
}
} finally {
Expand Down

0 comments on commit c4437ab

Please sign in to comment.