Skip to content

Commit

Permalink
add PDFInvalidException to show thrown exceptions
Browse files Browse the repository at this point in the history
The jHove error PDF_HUL_122 hides other thrown exceptions like PDF_HUL_1 in Destination. This pull request makes sure PDF_HUL_1 is shown
  • Loading branch information
samalloing authored Oct 12, 2023
1 parent d745990 commit e846e2f
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3486,6 +3486,12 @@ protected void addDestination(PdfObject itemObj, String propName,
propList.add(new Property(propName, PropertyType.STRING, PROP_VAL_NULL));
info.setMessage(new ErrorMessage(e.getJhoveMessage(), _parser.getOffset()));
info.setValid(false);
} catch (PdfInvalidException e) {
if (e.getJhoveMessage() != null) {
info.setMessage(new ErrorMessage(
JhoveMessages.getMessageInstance(
e.getJhoveMessage().getId(), e.getJhoveMessage().getMessage(),e.getJhoveMessage().getSubMessage() )));
}
} catch (Exception e) {

String msg = e.getClass().getName();
Expand Down

0 comments on commit e846e2f

Please sign in to comment.