@Service public class ExceptionMapperManagement extends Object
ExceptionMapper
s which can be registered to this service.Constructor and Description |
---|
ExceptionMapperManagement() |
Modifier and Type | Method and Description |
---|---|
<T extends Throwable> |
addExceptionMapper(ExceptionMapper<T> exceptionMapper)
Adds an
ExceptionMapper to the list of mappers. |
<T extends Throwable> |
addExceptionMappers(Set<ExceptionMapper<T>> exceptionMappers)
Adds a list of
ExceptionMapper to the list of mappers. |
<T extends Throwable> |
mapException(T exception)
Maps the given exception to a status.
|
<T extends Throwable> |
removeExceptionMapper(ExceptionMapper<T> exceptionMapper)
Removes the given mapper.
|
public <T extends Throwable> void addExceptionMapper(ExceptionMapper<T> exceptionMapper)
ExceptionMapper
to the list of mappers. Existing mappers for the given
exception will be replaced.T
- Type of the exception.exceptionMapper
- The exception mapper.@Autowired public <T extends Throwable> void addExceptionMappers(Set<ExceptionMapper<T>> exceptionMappers)
ExceptionMapper
to the list of mappers. Existing mappers for the given
exception will be replaced.T
- Type of the exception.exceptionMappers
- Set of exception mappers to add.public <T extends Throwable> Status mapException(T exception)
T
- Type of the exception.exception
- Exception to map.public <T extends Throwable> void removeExceptionMapper(ExceptionMapper<T> exceptionMapper)
T
- Type of the exception.exceptionMapper
- The mapper to remove.Copyright © 2019 Communote team. All rights reserved.