From 38164183690cb531a0d94787d93572107d6a5ec2 Mon Sep 17 00:00:00 2001 From: Ian Date: Wed, 12 Jun 2024 15:28:08 -0400 Subject: [PATCH] Always add the underlying cause of an exception --- .../org/openmrs/module/labonfhir/api/LabOrderHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/main/java/org/openmrs/module/labonfhir/api/LabOrderHandler.java b/api/src/main/java/org/openmrs/module/labonfhir/api/LabOrderHandler.java index 8ab7d84..fd3fea8 100644 --- a/api/src/main/java/org/openmrs/module/labonfhir/api/LabOrderHandler.java +++ b/api/src/main/java/org/openmrs/module/labonfhir/api/LabOrderHandler.java @@ -107,7 +107,7 @@ public Task createOrder(Order order) throws OrderCreationException { newTask = taskService.create(newTask); } catch (DAOException e) { - throw new OrderCreationException("Exception occurred while creating task for order " + order.getId()); + throw new OrderCreationException("Exception occurred while creating task for order " + order.getId(), e); } return newTask; } @@ -188,7 +188,7 @@ public Task createOrder(Encounter encounter) throws OrderCreationException { newTask = taskService.create(newTask); } catch (DAOException e) { - throw new OrderCreationException("Exception occurred while creating task for encounter " + encounter.getId()); + throw new OrderCreationException("Exception occurred while creating task for encounter " + encounter.getId(), e); } return newTask; }