I make a post request to my rest controller and as a result I want to get information about the error in case of incorrect data. Error information is generated in `@RestControllerAdvice`.  

Here is my advice class:

```java
@RestControllerAdvice
public class RestControllerErrorHandler {
    @ExceptionHandler(MethodArgumentNotValidException.class)
    @ResponseStatus(HttpStatus.BAD_REQUEST)
    public Map<String, Object> handleCustomerException(MethodArgumentNotValidException exception) {
        Map<String, Object> body = new LinkedHashMap<>();
        body.put("timestamp", new Date());
        body.put("exception", "MethodArgumentNotValidException");

        List<String> errors = exception
                .getBindingResult()
                .getFieldErrors()
                .stream()
                .map(DefaultMessageSourceResolvable::getDefaultMessage)
                .collect(Collectors.toList());

        body.put("errors", errors);
        return body;
    }
}

```

Here is the result of the error that I get.

```
{
  "timestamp": "2020-07-07T20:20:44.778+00:00",
  "exception": "MethodArgumentNotValidException",
  "errors": [
    "Login length: 6 - min and 10 - max",
    "Password length: 6 - min and 10 - max"
  ]
}

```

This is how I call method POST from ajax:

```js
$(document).ready(function () {
    $("#sendForm").click(function () {
        const login = $('input[name=login]').val();
        const password = $('input[name=password]').val();
        $.ajax({
            type: "POST",
            url: "/api/users",
            contentType: 'application/json',
            data: JSON.stringify({"login": login, "password": password}),
            dataType: "json",
            success: function (data) {
                alert('success: ' + data.id + " " + data.login + " " + data.password)
            },
            error: function (requestObject, error, errorThrown) {
                alert(error);//this field return "error" string
                alert(errorThrown);//for some reason this is empty when I get an error
            }
        });
    });
});

```

**How can I read it to get exactly the error information?** I want to display this: `"Login length: 6 - min and 10 - max", "Password length: 6 - min and 10 - max"` in `alert()`.