io.quarkus.code.rest.exceptions.QuarkusCommandExceptionMapper 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.commands.data.QuarkusCommandException;
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 QuarkusCommandExceptionMapper implements ExceptionMapper {
@Override
public Response toResponse(QuarkusCommandException e) {
String message = "Quarkus Command error > " + e.getLocalizedMessage();
return Response.status(Response.Status.BAD_REQUEST)
.entity(message)
.type(MediaType.TEXT_PLAIN)
.build();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy