Skip to content

Commit

Permalink
Prevent abort because of a throwable
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobat committed May 21, 2024
1 parent db5bcf2 commit cf04fa3
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,15 @@ public static <T> Optional<T> read(Class<T> clazz, Path path, MessageWriter log)
try {
final ObjectMapper mapper = getObjectMapper();
return Optional.of(mapper.readValue(path.toFile(), clazz));
} catch (Throwable e) {
} catch (Exception e) {
log.warn("[Quarkus build analytics] Could not read {}", path.toString(), e);
return Optional.empty();
} catch (Throwable t) {
log.error("[Quarkus build analytic] Unexpected error reading class " + t.getClass().getName() +
" from path: " + path.toString() +
". Got message: " + t.getMessage() +
". Attempting to continue...");
return Optional.empty();
}
}
}

0 comments on commit cf04fa3

Please sign in to comment.