diff --git a/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/OrderEventsDaoImpl.java b/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/OrderEventsDaoImpl.java index 7360e01..e81a7f0 100644 --- a/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/OrderEventsDaoImpl.java +++ b/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/OrderEventsDaoImpl.java @@ -93,7 +93,7 @@ private void makeSaveCall(Promise> promise, String query, OrderAudit LocalDateTime.ofInstant(orderAuditEvent.getActionDate().toInstant(), ZoneOffset.UTC), JsonObject.mapFrom(orderAuditEvent.getOrderSnapshot())), promise); } catch (Exception e) { - LOGGER.warn("Failed to save record with id: {} for order id: {} in to table {}", + LOGGER.error("Failed to save record with id: {} for order id: {} in to table {}", orderAuditEvent.getId(), orderAuditEvent.getOrderId(), TABLE_NAME, e); promise.fail(e); } diff --git a/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/OrderLineEventsDaoImpl.java b/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/OrderLineEventsDaoImpl.java index 47a4555..83881be 100644 --- a/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/OrderLineEventsDaoImpl.java +++ b/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/OrderLineEventsDaoImpl.java @@ -96,7 +96,7 @@ private void makeSaveCall(Promise> promise, String query, OrderLineA LocalDateTime.ofInstant(orderLineAuditEvent.getActionDate().toInstant(), ZoneOffset.UTC), JsonObject.mapFrom(orderLineAuditEvent.getOrderLineSnapshot())), promise); } catch (Exception e) { - LOGGER.warn("Failed to save record with id: {} for order line id: {} in to table {}", + LOGGER.error("Failed to save record with id: {} for order line id: {} in to table {}", orderLineAuditEvent.getId(), orderLineAuditEvent.getOrderLineId(), TABLE_NAME, e); promise.fail(e); } diff --git a/mod-audit-server/src/main/java/org/folio/rest/impl/AuditDataAcquisitionImpl.java b/mod-audit-server/src/main/java/org/folio/rest/impl/AuditDataAcquisitionImpl.java index bc1da9b..b5236ae 100644 --- a/mod-audit-server/src/main/java/org/folio/rest/impl/AuditDataAcquisitionImpl.java +++ b/mod-audit-server/src/main/java/org/folio/rest/impl/AuditDataAcquisitionImpl.java @@ -50,6 +50,7 @@ public void getAuditDataAcquisitionOrderById(String orderId, String sortBy, Audi orderAuditEventsService.getAuditEventsByOrderId(orderId, sortBy, sortOrder.name(), limit, offset, tenantId) .map(GetAuditDataAcquisitionOrderByIdResponse::respond200WithApplicationJson) .map(Response.class::cast) + .otherwise(this::mapExceptionToResponse) .onComplete(asyncResultHandler); } catch (Exception e) { LOGGER.error("Failed to get order audit events by order id: {}", orderId, e); @@ -67,6 +68,7 @@ public void getAuditDataAcquisitionOrderLineById(String orderLineId, String sort orderLineAuditEventsService.getAuditEventsByOrderLineId(orderLineId, sortBy, sortOrder.name(), limit, offset, tenantId) .map(GetAuditDataAcquisitionOrderLineByIdResponse::respond200WithApplicationJson) .map(Response.class::cast) + .otherwise(this::mapExceptionToResponse) .onComplete(asyncResultHandler); } catch (Exception e) { LOGGER.error("Failed to get order line audit events by order line id: {}", orderLineId, e); @@ -85,6 +87,7 @@ public void getAuditDataAcquisitionPieceById(String pieceId, String sortBy, Audi pieceAuditEventsService.getAuditEventsByPieceId(pieceId, sortBy, sortOrder.name(), limit, offset, tenantId) .map(GetAuditDataAcquisitionPieceByIdResponse::respond200WithApplicationJson) .map(Response.class::cast) + .otherwise(this::mapExceptionToResponse) .onComplete(asyncResultHandler); } catch (Exception e) { LOGGER.error("Failed to get piece audit events by piece id: {}", pieceId, e); @@ -104,6 +107,7 @@ public void getAuditDataAcquisitionPieceStatusChangeHistoryById(String pieceId, pieceAuditEventsService.getAuditEventsWithStatusChangesByPieceId(pieceId, sortBy, sortOrder.name(), limit, offset, tenantId) .map(GetAuditDataAcquisitionPieceByIdResponse::respond200WithApplicationJson) .map(Response.class::cast) + .otherwise(this::mapExceptionToResponse) .onComplete(asyncResultHandler); } catch (Exception e) { LOGGER.error("Failed to get piece audit events with unique status change by piece id: {}", pieceId, e);