@Component @InjectProperties(prefix="servicecomb.invocation.exception") public class DefaultExceptionProcessor extends Object implements ExceptionProcessor
| Modifier and Type | Field and Description |
|---|---|
static int |
ORDER |
protected boolean |
printRateLimit |
protected boolean |
printStackTrace |
| Constructor and Description |
|---|
DefaultExceptionProcessor() |
| Modifier and Type | Method and Description |
|---|---|
InvocationException |
convert(Invocation invocation,
Throwable throwable) |
InvocationException |
convert(Invocation invocation,
Throwable throwable,
javax.ws.rs.core.Response.StatusType genericStatus) |
int |
getOrder() |
boolean |
isIgnoreLog(Invocation invocation,
InvocationException exception) |
boolean |
isPrintRateLimit() |
boolean |
isPrintStackTrace() |
void |
logConsumerException(Invocation invocation,
InvocationException exception) |
void |
logProducerException(Invocation invocation,
InvocationException exception) |
DefaultExceptionProcessor |
setConverters(List<ExceptionConverter<? extends Throwable>> converters) |
DefaultExceptionProcessor |
setPrintRateLimit(boolean printRateLimit) |
DefaultExceptionProcessor |
setPrintStackTrace(boolean printStackTrace) |
Response |
toConsumerResponse(Invocation invocation,
Throwable throwable) |
Response |
toProducerResponse(Invocation invocation,
Throwable exception) |
public static final int ORDER
@InjectProperty(keys="print-stack-trace",
defaultValue="false")
protected boolean printStackTrace
@InjectProperty(keys="print-rate-limit",
defaultValue="false")
protected boolean printRateLimit
public int getOrder()
getOrder in interface ExceptionProcessorgetOrder in interface org.springframework.core.Orderedpublic boolean isPrintStackTrace()
isPrintStackTrace in interface ExceptionProcessorpublic DefaultExceptionProcessor setPrintStackTrace(boolean printStackTrace)
public boolean isPrintRateLimit()
public DefaultExceptionProcessor setPrintRateLimit(boolean printRateLimit)
@Autowired(required=false) public DefaultExceptionProcessor setConverters(List<ExceptionConverter<? extends Throwable>> converters)
public InvocationException convert(@Nonnull Invocation invocation, Throwable throwable)
convert in interface ExceptionProcessorpublic InvocationException convert(@Nullable Invocation invocation, Throwable throwable, javax.ws.rs.core.Response.StatusType genericStatus)
convert in interface ExceptionProcessorpublic Response toConsumerResponse(Invocation invocation, Throwable throwable)
toConsumerResponse in interface ExceptionProcessorpublic void logConsumerException(@Nonnull Invocation invocation, @Nonnull InvocationException exception)
logConsumerException in interface ExceptionProcessorpublic boolean isIgnoreLog(@Nonnull Invocation invocation, @Nonnull InvocationException exception)
isIgnoreLog in interface ExceptionProcessorpublic Response toProducerResponse(@Nullable Invocation invocation, Throwable exception)
toProducerResponse in interface ExceptionProcessorpublic void logProducerException(@Nonnull Invocation invocation, @Nonnull InvocationException exception)
logProducerException in interface ExceptionProcessorCopyright © 2017–2022 The Apache Software Foundation. All rights reserved.