Skip to content

Commit

Permalink
[MODAUD-174] - Improved AuditDataAcquisitionImpl and changed debug to…
Browse files Browse the repository at this point in the history
… error level in catch block
  • Loading branch information
azizbekxm committed Nov 15, 2023
1 parent ec50fb3 commit 26bcef4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private void makeSaveCall(Promise<RowSet<Row>> 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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private void makeSaveCall(Promise<RowSet<Row>> 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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 26bcef4

Please sign in to comment.