|
@@ -26,6 +26,7 @@ import com.fasterxml.jackson.databind.exc.InvalidFormatException;
|
|
|
import com.google.common.collect.ImmutableMap;
|
|
|
import lombok.NonNull;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.TypeMismatchException;
|
|
|
import org.springframework.boot.web.servlet.error.ErrorController;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.http.converter.HttpMessageConversionException;
|
|
@@ -163,6 +164,8 @@ public class GlobalExceptionInterceptor implements ErrorController {
|
|
|
this.format(((MethodArgumentNotValidException) e).getBindingResult()));
|
|
|
} else if (e instanceof MethodArgumentTypeMismatchException) {
|
|
|
return Result.build(HttpStatus.PRECONDITION_FAILED, this.format((MethodArgumentTypeMismatchException) e));
|
|
|
+ } else if (e instanceof TypeMismatchException) {
|
|
|
+ return Result.build(HttpStatus.BAD_REQUEST);
|
|
|
} else if (e instanceof ParameterInvalidException) {
|
|
|
return Result.build(HttpStatus.PRECONDITION_FAILED, ((ParameterInvalidException) e).getErrors());
|
|
|
} else if (e instanceof MissingServletRequestPartException) {
|