use of com.linkedin.restli.server.errors.MockInputError in project rest.li by linkedin.
the class MockValidationErrorHandler method updateErrorDetails.
@Override
public void updateErrorDetails(RestLiServiceException exception, Collection<Message> messages) {
MockBadRequest badRequest = new MockBadRequest();
MockInputErrorArray inputErrors = new MockInputErrorArray();
for (Message message : messages) {
if (message.isError() && message.getErrorDetails() instanceof MockInputError) {
inputErrors.add((MockInputError) message.getErrorDetails());
}
}
badRequest.setInputErrors(inputErrors);
exception.setErrorDetails(badRequest);
exception.setCode(ERROR_CODE);
}
use of com.linkedin.restli.server.errors.MockInputError in project rest.li by linkedin.
the class MockValidationErrorHandler method updateErrorDetails.
@Override
public void updateErrorDetails(RestLiServiceException exception, Map<String, Collection<Message>> messages) {
MockBadRequest badRequest = new MockBadRequest();
MockInputErrorArray inputErrors = new MockInputErrorArray();
for (Map.Entry<String, Collection<Message>> entry : messages.entrySet()) {
for (Message message : entry.getValue()) {
if (message.isError() && message.getErrorDetails() instanceof MockInputError) {
MockInputError inputError = (MockInputError) message.getErrorDetails();
inputError.setKey(entry.getKey());
inputErrors.add(inputError);
}
}
}
badRequest.setInputErrors(inputErrors);
exception.setErrorDetails(badRequest);
exception.setCode(ERROR_CODE);
}
Aggregations