Interface MonitoredRequestErrorParser<T extends MonitoredRequestErrorModel>
- All Known Implementing Classes:
AbstractErrorParser,DefaultExceptionOutboundRequestErrorParser,DefaultFallbackOutboundRequestErrorParser,DefaultHttp404OutboundRequestErrorParser,JsonMonitoredRequestErrorParser,XmlMonitoredRequestErrorParser
public interface MonitoredRequestErrorParser<T extends MonitoredRequestErrorModel>
A parser which extracts an
MonitoredRequestError out of an Response.-
Method Summary
Modifier and TypeMethodDescriptionbooleanisApplicable(String contentType, int statusCode) Indicates whether this MonitoredRequestErrorParser is applicable to the given ResponseparseErrorFrom(Class<T> error, int statusCode, String responseBody) Gets theMonitoredRequestErrorvalue from the Response
-
Method Details
-
isApplicable
Indicates whether this MonitoredRequestErrorParser is applicable to the given Response- Parameters:
contentType- Response content typestatusCode- response status code- Returns:
- true if can parse, otherwise false
-
parseErrorFrom
Gets theMonitoredRequestErrorvalue from the Response- Parameters:
error- class to be instantiated as errorstatusCode- response status coderesponseBody- Response body to extract the error from- Returns:
- the error to persist as part of the
MonitoredRequestErrorParser
-