// Path: src/main/java/org/mockenize/model/ReturnBean.java
// public class ReturnBean implements Serializable {
// 
// 	private static final long serialVersionUID = 1L;
// 
// 	private String message;
// 
// 	@JsonInclude(Include.NON_NULL)
// 	private Class<?> exceptionClass;
// 
// 	public ReturnBean(Throwable throwable) {
// 		message = throwable.getMessage();
// 		exceptionClass = throwable.getClass();
// 	}
// 
// 	public ReturnBean(String message) {
// 		this.message = message;
// 	}
// 
// 	public String getMessage() {
// 		return message;
// 	}
// 
// 	public void setMessage(String message) {
// 		this.message = message;
// 	}
// 
// 	public Class<?> getExceptionClass() {
// 		return exceptionClass;
// 	}
// 
// 	public void setExceptionClass(Class<?> exceptionClass) {
// 		this.exceptionClass = exceptionClass;
// 	}
// 
// }


import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.mockenize.model.ReturnBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
package org.mockenize.provider.mapper;



public class ExceptionMapperImpl implements javax.ws.rs.ext.ExceptionMapper<Throwable> {

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

	private static final String CONTENT_TYPE = "Content-Type";

	@Override
	public Response toResponse(Throwable throwable) {
		LOGGER.error(throwable.getMessage(), throwable);
		int status = Response.Status.INTERNAL_SERVER_ERROR.getStatusCode();
		if (throwable instanceof WebApplicationException) {
			status = ((WebApplicationException) throwable).getResponse().getStatus();
		}
// Path: src/main/java/org/mockenize/model/ReturnBean.java
// public class ReturnBean implements Serializable {
// 
// 	private static final long serialVersionUID = 1L;
// 
// 	private String message;
// 
// 	@JsonInclude(Include.NON_NULL)
// 	private Class<?> exceptionClass;
// 
// 	public ReturnBean(Throwable throwable) {
// 		message = throwable.getMessage();
// 		exceptionClass = throwable.getClass();
// 	}
// 
// 	public ReturnBean(String message) {
// 		this.message = message;
// 	}
// 
// 	public String getMessage() {
// 		return message;
// 	}
// 
// 	public void setMessage(String message) {
// 		this.message = message;
// 	}
// 
// 	public Class<?> getExceptionClass() {
// 		return exceptionClass;
// 	}
// 
// 	public void setExceptionClass(Class<?> exceptionClass) {
// 		this.exceptionClass = exceptionClass;
// 	}
// 
// }


// Path: src/main/java/org/mockenize/provider/mapper/ExceptionMapperImpl.java
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.mockenize.model.ReturnBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

package org.mockenize.provider.mapper;



public class ExceptionMapperImpl implements javax.ws.rs.ext.ExceptionMapper<Throwable> {

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

	private static final String CONTENT_TYPE = "Content-Type";

	@Override
	public Response toResponse(Throwable throwable) {
		LOGGER.error(throwable.getMessage(), throwable);
		int status = Response.Status.INTERNAL_SERVER_ERROR.getStatusCode();
		if (throwable instanceof WebApplicationException) {
			status = ((WebApplicationException) throwable).getResponse().getStatus();
		}
		return Response.status(status).header(CONTENT_TYPE, MediaType.APPLICATION_JSON).entity(new ReturnBean(throwable)).build();