Skip to content

Commit 0a5e4b3

Browse files
committed
add log in validation exception mapper
1 parent 8f2569a commit 0a5e4b3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

EVAM04_EMISIONVOTO_API/src/main/java/edu/cibertec/votoelectronico/validation/ValidationExceptionMapper.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,19 @@
99
import javax.ws.rs.ext.ExceptionMapper;
1010
import javax.ws.rs.ext.Provider;
1111

12+
import org.slf4j.Logger;
13+
import org.slf4j.LoggerFactory;
14+
1215
import edu.cibertec.votoelectronico.resource.communication.ValidationResponse;
1316

1417
@Provider
1518
public class ValidationExceptionMapper implements ExceptionMapper<ConstraintViolationException> {
1619

20+
private final Logger LOG = LoggerFactory.getLogger(ValidationExceptionMapper.class);
21+
1722
@Override
1823
public Response toResponse(ConstraintViolationException exception) {
24+
LOG.warn(exception.getMessage());
1925
Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
2026
Map<String, String> validations = new HashMap<String, String>();
2127
exception.getConstraintViolations().forEach(v -> {

0 commit comments

Comments
 (0)