/** * Convenience method to respond to fatal errors by moving the queue entry into an error bin * prior to aborting */ private void setFatalError(HL7InQueue hl7InQueue, String error, Throwable cause) { HL7InError hl7InError = new HL7InError(hl7InQueue); hl7InError.setError(error); if (cause == null) { hl7InError.setErrorDetails(""); } else { log.error("Fatal error", cause); hl7InError.setErrorDetails(ExceptionUtils.getStackTrace(cause)); } Context.getHL7Service().saveHL7InError(hl7InError); Context.getHL7Service().purgeHL7InQueue(hl7InQueue); log.info(error, cause); }
Context.getHL7Service().purgeHL7InQueue(hl7InQueue);