diff --git a/plugin/src/main/java/org/opensearch/ml/utils/MLExceptionUtils.java b/plugin/src/main/java/org/opensearch/ml/utils/MLExceptionUtils.java index 3799b0955a..e831388b86 100644 --- a/plugin/src/main/java/org/opensearch/ml/utils/MLExceptionUtils.java +++ b/plugin/src/main/java/org/opensearch/ml/utils/MLExceptionUtils.java @@ -46,7 +46,9 @@ public static void logException(String errorMessage, Exception e, Logger log) { Throwable rootCause = ExceptionUtils.getRootCause(e); if (e instanceof MLLimitExceededException || e instanceof MLResourceNotFoundException || e instanceof IllegalArgumentException) { log.warn(e.getMessage()); - } else if (rootCause instanceof MLLimitExceededException || rootCause instanceof MLResourceNotFoundException || rootCause instanceof IllegalArgumentException) { + } else if (rootCause instanceof MLLimitExceededException + || rootCause instanceof MLResourceNotFoundException + || rootCause instanceof IllegalArgumentException) { log.warn(rootCause.getMessage()); } else { log.error(errorMessage, e);