From a4ba65a9fd42fac3bebecae4e12b836df6a14938 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Thu, 9 Sep 2021 12:27:34 -0400 Subject: [PATCH] Don't wrap known errors --- .../java/ca/uhn/fhir/jpa/dao/BaseTransactionProcessor.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseTransactionProcessor.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseTransactionProcessor.java index 359c9936fdf..d40d555a8de 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseTransactionProcessor.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseTransactionProcessor.java @@ -1691,7 +1691,7 @@ public abstract class BaseTransactionProcessor { private final Map myResponseMap; private final int myResponseOrder; private final boolean myNestedMode; - private Throwable myLastSeenException; + private BaseServerResponseException myLastSeenException; protected RetriableBundleTask(CountDownLatch theCompletedLatch, RequestDetails theRequestDetails, Map theResponseMap, int theResponseOrder, IBase theNextReqEntry, boolean theNestedMode) { this.myCompletedLatch = theCompletedLatch; @@ -1731,7 +1731,7 @@ public abstract class BaseTransactionProcessor { myLastSeenException = e; return false; } catch (Throwable t) { - myLastSeenException = t; + myLastSeenException = new InternalErrorException(t); //If we have caught a non-tag-storage failure we are unfamiliar with, or we have exceeded max attempts, exit. if (!DaoFailureUtil.isTagStorageFailure(t) || attempt >= maxAttempts) { ourLog.error("Failure during BATCH sub transaction processing", t); @@ -1755,7 +1755,7 @@ public abstract class BaseTransactionProcessor { private void populateResponseMapWithLastSeenException() { BaseServerResponseExceptionHolder caughtEx = new BaseServerResponseExceptionHolder(); - caughtEx.setException(new InternalErrorException(myLastSeenException)); + caughtEx.setException(myLastSeenException); myResponseMap.put(myResponseOrder, caughtEx); }