All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.zandero.rest.exception.ConstraintExceptionHandler Maven / Gradle / Ivy

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