Skip to content

Commit

Permalink
Unify exception handling.
Browse files Browse the repository at this point in the history
Generalize to catch all exceptions and condense exception handling code and error messages.

Co-authored-by: Melissa Linkert <[email protected]>
Co-authored-by: Sébastien Besson <[email protected]>
  • Loading branch information
3 people committed Sep 17, 2024
1 parent 2c3f72a commit e39e422
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions components/bio-formats-tools/src/loci/formats/tools/ImageInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -1146,18 +1146,8 @@ public static void main(String[] args) throws Exception {
try {
new ImageInfo().testRead(newArgs);
}
catch (FormatException e) {
LOGGER.error("Caught FormatException. " + e.getMessage());
exitCode = 1;
continue;
}
catch (IOException e) {
LOGGER.error("Caught IOException. " + e.getMessage());
exitCode = 1;
continue;
}
catch (ServiceException e) {
LOGGER.error("Caught ServiceException. " + e.getMessage());
catch (Exception e) {
LOGGER.error("Caught " + e.getClass().getSimpleName(), e);
exitCode = 1;
continue;
}
Expand Down

0 comments on commit e39e422

Please sign in to comment.