From e9d5c05e8627e65b6980a5b8042e0f545189a8c1 Mon Sep 17 00:00:00 2001 From: philipliu Date: Fri, 16 Feb 2024 13:32:54 -0500 Subject: [PATCH] Lower request validation error log level --- .../controller/GlobalControllerExceptionHandler.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/platform/src/main/java/org/stellar/anchor/platform/controller/GlobalControllerExceptionHandler.java b/platform/src/main/java/org/stellar/anchor/platform/controller/GlobalControllerExceptionHandler.java index a16cd3403..953cdeeec 100644 --- a/platform/src/main/java/org/stellar/anchor/platform/controller/GlobalControllerExceptionHandler.java +++ b/platform/src/main/java/org/stellar/anchor/platform/controller/GlobalControllerExceptionHandler.java @@ -1,6 +1,6 @@ package org.stellar.anchor.platform.controller; -import static org.stellar.anchor.util.Log.errorEx; +import static org.stellar.anchor.util.Log.*; import javax.transaction.NotSupportedException; import org.springframework.http.HttpStatus; @@ -18,14 +18,14 @@ public class GlobalControllerExceptionHandler { @ResponseStatus(HttpStatus.BAD_REQUEST) @ExceptionHandler({SepValidationException.class, BadRequestException.class}) public SepExceptionResponse handleBadRequest(AnchorException ex) { - errorEx(ex); + warnEx(ex); return new SepExceptionResponse(ex.getMessage()); } @ResponseStatus(HttpStatus.BAD_REQUEST) @ExceptionHandler(MissingServletRequestParameterException.class) public SepExceptionResponse handleMissingParams(MissingServletRequestParameterException ex) { - errorEx(ex); + warnEx(ex); String name = ex.getParameterName(); return new SepExceptionResponse(String.format("The \"%s\" parameter is missing.", name)); } @@ -41,6 +41,7 @@ public SepExceptionResponse handleRandomException(HttpMessageNotReadableExceptio @ExceptionHandler({SepNotAuthorizedException.class}) public SepExceptionResponse handleAuthError(SepException ex) { errorEx(ex); + return new SepExceptionResponse(ex.getMessage()); }