// Path: locate-api-service/src/main/java/uk/gov/gds/locate/api/exceptions/LocateWebException.java
// public class LocateWebException extends Exception {
// 
//     protected static final String CONTENT_TYPE = "application/json; charset=utf-8";
//     protected static final String CONTENT_TYPE_HEADER = "Content-Type";
// 
//     private final int statusCode;
//     private final Object body;
// 
// 
//     public LocateWebException(int statusCode, Object body) {
//         this.statusCode = statusCode;
//         this.body = body;
//     }
// 
//     public int getStatusCode() {
//         return statusCode;
//     }
// 
//     public Object getBody() {
//         return body;
//     }
// 
//     public Response getResponse() {
//         return Response
//                 .status(statusCode)
//                 .header(CONTENT_TYPE_HEADER, CONTENT_TYPE)
//                 .entity(body)
//                 .build();
//     }
// 
// 
//     @Override
//     public String toString() {
//         return "LocateWebException{" +
//                 "statusCode=" + statusCode +
//                 ", body=" + body +
//                 '}';
//     }
// }


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import uk.gov.gds.locate.api.exceptions.LocateWebException;
import javax.ws.rs.Produces;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.Provider;
package uk.gov.gds.locate.api;



@Provider
@Produces(MediaType.APPLICATION_JSON)
public class LocateExceptionMapper implements javax.ws.rs.ext.ExceptionMapper<Throwable> {

    private static final Logger LOGGER = LoggerFactory.getLogger(LocateExceptionMapper.class);

    protected static final String CONTENT_TYPE = "application/json; charset=utf-8";
    protected static final String CONTENT_TYPE_HEADER = "Content-Type";

    @Override
    public Response toResponse(Throwable exception) {

// Path: locate-api-service/src/main/java/uk/gov/gds/locate/api/exceptions/LocateWebException.java
// public class LocateWebException extends Exception {
// 
//     protected static final String CONTENT_TYPE = "application/json; charset=utf-8";
//     protected static final String CONTENT_TYPE_HEADER = "Content-Type";
// 
//     private final int statusCode;
//     private final Object body;
// 
// 
//     public LocateWebException(int statusCode, Object body) {
//         this.statusCode = statusCode;
//         this.body = body;
//     }
// 
//     public int getStatusCode() {
//         return statusCode;
//     }
// 
//     public Object getBody() {
//         return body;
//     }
// 
//     public Response getResponse() {
//         return Response
//                 .status(statusCode)
//                 .header(CONTENT_TYPE_HEADER, CONTENT_TYPE)
//                 .entity(body)
//                 .build();
//     }
// 
// 
//     @Override
//     public String toString() {
//         return "LocateWebException{" +
//                 "statusCode=" + statusCode +
//                 ", body=" + body +
//                 '}';
//     }
// }


// Path: locate-api-service/src/main/java/uk/gov/gds/locate/api/LocateExceptionMapper.java
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import uk.gov.gds.locate.api.exceptions.LocateWebException;
import javax.ws.rs.Produces;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.Provider;

package uk.gov.gds.locate.api;



@Provider
@Produces(MediaType.APPLICATION_JSON)
public class LocateExceptionMapper implements javax.ws.rs.ext.ExceptionMapper<Throwable> {

    private static final Logger LOGGER = LoggerFactory.getLogger(LocateExceptionMapper.class);

    protected static final String CONTENT_TYPE = "application/json; charset=utf-8";
    protected static final String CONTENT_TYPE_HEADER = "Content-Type";

    @Override
    public Response toResponse(Throwable exception) {

        if (exception instanceof LocateWebException) {