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

org.davidmoten.oa3.codegen.spring.runtime.ControllerExceptionHandler Maven / Gradle / Ivy

The newest version!
package org.davidmoten.oa3.codegen.spring.runtime;

import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;

public interface ControllerExceptionHandler {

    @ResponseStatus(HttpStatus.BAD_REQUEST) // 400
    @ExceptionHandler(BadRequestException.class)
    default DefaultError handleBadRequestException(BadRequestException e) {
        return new DefaultError(HttpStatus.BAD_REQUEST.value(), e.getMessage());
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy