package org.zalando.problem.spring.web.advice.io;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.multipart.MultipartException;
import org.zalando.problem.Problem;
import org.zalando.problem.spring.web.advice.AdviceTrait;
import javax.ws.rs.core.Response.Status;
// TODO find a better name
public interface MultipartAdviceTrait extends AdviceTrait {
@ExceptionHandler
default ResponseEntity<Problem> handleMultipart(
final MultipartException exception,
final NativeWebRequest request) {
return create(Status.BAD_REQUEST, exception, request);
}
}