Skip to content

Commit

Permalink
refactor(api): make Index API check on most specific exception type o…
Browse files Browse the repository at this point in the history
…nly IQSS#8305

This avoids potential trouble were it's unclear from where the higher exceptions come from, javax or jakarta namespace.
  • Loading branch information
poikilotherm committed Mar 25, 2022
1 parent e0edc6c commit 0b59c3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/edu/harvard/iq/dataverse/api/Index.java
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ private Response indexAllOrSubset(Long numPartitionsSelected, Long partitionIdTo
}
}
}
if (sb.toString().equals("javax.ejb.EJBException: Transaction aborted javax.transaction.RollbackException java.lang.IllegalStateException ")) {
if (sb.toString().contains("java.lang.IllegalStateException ")) {
return ok("indexing went as well as can be expected... got java.lang.IllegalStateException but some indexing may have happened anyway");
} else {
return error(Status.INTERNAL_SERVER_ERROR, sb.toString());
Expand Down

0 comments on commit 0b59c3d

Please sign in to comment.