io.quarkus.code.rest.exceptions.CodestartExceptionMapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of code-quarkus Show documentation
Show all versions of code-quarkus Show documentation
Customize a Web Interface to generate Quarkus starter projects.
package io.quarkus.code.rest.exceptions;
import io.quarkus.devtools.codestarts.CodestartException;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper;
import jakarta.ws.rs.ext.Provider;
@Provider
public class CodestartExceptionMapper implements ExceptionMapper {
@Override
public Response toResponse(CodestartException e) {
String message = "Bad request > " + e.getMessage();
return Response.status(Response.Status.BAD_REQUEST)
.entity(message)
.type(MediaType.TEXT_PLAIN)
.build();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy