com.oath.micro.server.general.exception.mapper.ExtensionMapOfExceptionsToErrorCodes Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of micro-general-exception-mapper Show documentation
Show all versions of micro-general-exception-mapper Show documentation
Opinionated rest microservices
package com.oath.micro.server.general.exception.mapper;
import java.util.LinkedHashMap;
import javax.ws.rs.core.Response.Status;
import cyclops.data.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();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy