net.leanix.dropkit.WebApplicationException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of leanix-dropkit Show documentation
Show all versions of leanix-dropkit Show documentation
Base functionality for leanIX dropwizard-based services
package net.leanix.dropkit;
import javax.ws.rs.core.Response;
/**
* Convenience class to avoid boilerplate code, allows sending an error message.
*
*
*
*/
public class WebApplicationException extends javax.ws.rs.WebApplicationException {
public static javax.ws.rs.WebApplicationException withMessage(Response.Status status, String errorMessage) {
Response response = Response.status(status).entity(errorMessage).build();
return new javax.ws.rs.WebApplicationException(response);
}
public static javax.ws.rs.WebApplicationException withPayload(Response.Status status, Object o) {
Response response = Response.status(status).entity(o).build();
return new javax.ws.rs.WebApplicationException(response);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy