
com.zandero.rest.exception.ConstraintExceptionHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rest.vertx Show documentation
Show all versions of rest.vertx Show documentation
JAX-RS REST annotation processor for vert.x verticals
The newest version!
package com.zandero.rest.exception;
import com.zandero.rest.annotation.*;
import io.vertx.core.http.*;
/**
*
*/
@Deprecated(forRemoval = true)
@Header("X-Status-Reason: Validation failed")
public class ConstraintExceptionHandler implements ExceptionHandler {
@Override
public void write(ConstraintException result, HttpServerRequest request, HttpServerResponse response) {
response.setStatusCode(400); // to be discussed ... 400 or should use 422 instead?
response.end(result.getMessage());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy