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

templates.qeex.QuarkusWebExceptionProvider.ftl Maven / Gradle / Ivy

There is a newer version: 3.0.3
Show newest version
package ${groupId}.api.qeex.rs;

import ${groupId}.api.qeex.exceptions.QeexWebException;

import jakarta.ws.rs.Produces;
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 QuarkusWebExceptionProvider implements ExceptionMapper {

    @Override
    @Produces(MediaType.APPLICATION_JSON)
    public Response toResponse(QeexWebException exception) {
        return Response
                .status(exception.code)
                .entity(exception.toJson())
                .build();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy