com.aol.micro.server.general.exception.mapper.ExtensionMapOfExceptionsToErrorCodes Maven / Gradle / Ivy
package com.aol.micro.server.general.exception.mapper;
import java.util.LinkedHashMap;
import javax.ws.rs.core.Response.Status;
import org.jooq.lambda.tuple.Tuple2;
/**
* Create a Spring that implements this interface to define your own mappings between
* Exceptions and Error Codes
*
* @author johnmcclean
*
*
* {@code
* Default values are
* Map, Tuple2> mapOfExceptionsToErrorCodes = new LinkedHashMap<>();
{
mapOfExceptionsToErrorCodes.put(EOFException.class, new Tuple2(EMPTY_REQUEST, Status.BAD_REQUEST));
mapOfExceptionsToErrorCodes.put(JsonProcessingException.class, new Tuple2(JSON_PROCESSING_EXCEPTION, Status.BAD_REQUEST));
}
* }
*
*
*
*
*
*/
public interface ExtensionMapOfExceptionsToErrorCodes {
public LinkedHashMap, Tuple2> getErrorMappings();
}