From 45c93727632370473563f5439110b6388901e57d Mon Sep 17 00:00:00 2001 From: "chris.ditcher" Date: Mon, 9 Sep 2024 13:36:16 -0700 Subject: [PATCH] Cleaning up code --- .../java/ca/bc/gov/educ/api/trax/config/RestErrorHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/src/main/java/ca/bc/gov/educ/api/trax/config/RestErrorHandler.java b/api/src/main/java/ca/bc/gov/educ/api/trax/config/RestErrorHandler.java index 39fd4f06..1f948717 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/trax/config/RestErrorHandler.java +++ b/api/src/main/java/ca/bc/gov/educ/api/trax/config/RestErrorHandler.java @@ -71,7 +71,8 @@ protected ResponseEntity handleConflict(RuntimeException ex) { @ExceptionHandler(value = { JpaObjectRetrievalFailureException.class, DataRetrievalFailureException.class, EntityNotFoundException.class }) protected ResponseEntity handleEntityNotFound(RuntimeException ex) { - // no need to log EntityNotFoundExceptions as they are expected + // no need to log EntityNotFoundExceptions as error + // it is used to denote NOT FOUND and is normal part of operations if(!(ex instanceof EntityNotFoundException)){ log.error("JPA ERROR IS: {}", ex.getClass().getName(), ex); }