From ec50fb3de0eb51ff01b7908f8abe4277974a3499 Mon Sep 17 00:00:00 2001 From: azizbekxm Date: Wed, 15 Nov 2023 17:39:53 +0500 Subject: [PATCH] [MODAUD-174] - Improved AuditDataAcquisitionImpl --- .../org/folio/rest/impl/AuditDataAcquisitionImpl.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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 6a96255..bc1da9b 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,10 +50,9 @@ 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.warn("Failed to get order audit events by order id: {}", orderId, e); + LOGGER.error("Failed to get order audit events by order id: {}", orderId, e); asyncResultHandler.handle(Future.succeededFuture(mapExceptionToResponse(e))); } } @@ -68,10 +67,9 @@ 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.warn("Failed to get order line audit events by order line id: {}", orderLineId, e); + LOGGER.error("Failed to get order line audit events by order line id: {}", orderLineId, e); asyncResultHandler.handle(Future.succeededFuture(mapExceptionToResponse(e))); } @@ -87,7 +85,6 @@ 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); @@ -107,10 +104,9 @@ 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.warn("Failed to get piece audit events with unique status change by piece id: {}", pieceId, e); + LOGGER.error("Failed to get piece audit events with unique status change by piece id: {}", pieceId, e); asyncResultHandler.handle(Future.succeededFuture(mapExceptionToResponse(e))); } }