public interface ExceptionTranslator
Created by zhanghaolun on 16/8/9.
Modifier and Type | Interface and Description |
---|---|
static class |
ExceptionTranslator.Location |
Modifier and Type | Method and Description |
---|---|
Optional<ExceptionTranslator.Location> |
find(Throwable throwable)
locate info.
|
Optional<String> |
localizedMessage(String template,
org.springframework.web.context.request.RequestAttributes request,
Throwable throwable,
Map<String,Serializable> contextVariables)
Translate exception and generates localized message.
|
static org.springframework.context.HierarchicalMessageSource |
rootMessageSource(org.springframework.context.MessageSource messageSource)
Deprecated.
|
Optional<Integer> |
status(ExceptionTranslator.Location location) |
Optional<String> |
template(ExceptionTranslator.Location location) |
@Deprecated static org.springframework.context.HierarchicalMessageSource rootMessageSource(org.springframework.context.MessageSource messageSource)
Optional<ExceptionTranslator.Location> find(Throwable throwable)
throwable
- The exception to handle and get data from.Optional<String> localizedMessage(String template, org.springframework.web.context.request.RequestAttributes request, Throwable throwable, Map<String,Serializable> contextVariables)
template
- templaterequest
- The current request attributes.throwable
- throwablecontextVariables
- The variables in contextOptional<Integer> status(ExceptionTranslator.Location location)
Optional<String> template(ExceptionTranslator.Location location)
Copyright © 2017. All rights reserved.