public class DefaultServiceErrorAttributes extends AbstractServiceErrorAttributes
| Constructor and Description |
|---|
DefaultServiceErrorAttributes() |
| Modifier and Type | Method and Description |
|---|---|
void |
decorateErrorAttributes(Map<String,Object> errorAttributes,
Map<String,Object> serviceErrorAttributes)
Decorate error attributes, add extension attributes etc.
|
Object |
decorateExceptionCode(Exception exception)
Decorate exception error code, custom for your business logic.
|
String |
decorateExceptionMessage(Exception exception)
Decorate exception message for your self.
|
getErrorAttributesgetError, getHandlerExecutionException, getMessage, getStatus, resolveException, responseOKpublic String decorateExceptionMessage(Exception exception)
decorateExceptionMessage in class AbstractServiceErrorAttributesexception - the exception that got thrown during handler executionpublic Object decorateExceptionCode(Exception exception)
public Object decorateExceptionCode(Exception exception) {
if (exception instanceof IndexOutOfBoundsException) {
return 123;
}
return super.decorateExceptionCode(exception);
}
decorateExceptionCode in class AbstractServiceErrorAttributesexception - the exception that got thrown during handler executionpublic void decorateErrorAttributes(Map<String,Object> errorAttributes, Map<String,Object> serviceErrorAttributes)
errorAttributes that has exception, handler, message,
error, timestamp, status, path params.decorateErrorAttributes in class AbstractServiceErrorAttributeserrorAttributes - error attributesserviceErrorAttributes - service error attributesCopyright © 2021. All rights reserved.