zhoutianli518 opened a new issue #2605:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2605
java-Chassis sdk在打印异常时,能否将堆栈打出来,便于问题的定位。比如:
org.apache.servicecomb.core.handler.impl.ProducerOperationHandler的如下代码,当出现异常后,打印的日志里,没有将异常堆栈打印出来,只是打印了异常的message,导致出现运行期异常时,很难定位问题。
public Response doInvoke(Invocation invocation, SwaggerProducerOperation
producerOperation) {
Response response;
try {
invocation.onBusinessMethodStart();
Object[] args = invocation.toProducerArguments();
for (ProducerInvokeExtension producerInvokeExtension :
producerOperation.getProducerInvokeExtenstionList()) {
producerInvokeExtension.beforeMethodInvoke(invocation,
producerOperation, args);
}
Object result =
producerOperation.getProducerMethod().invoke(producerOperation.getProducerInstance(),
args);
response =
producerOperation.getResponseMapper().mapResponse(invocation.getStatus(),
result);
invocation.onBusinessMethodFinish();
invocation.onBusinessFinish();
} catch (Throwable e) {
if (shouldPrintErrorLog(e)) {
invocation.getTraceIdLogger().error(LOGGER, "unexpected error
operation={}, message={}",
invocation.getInvocationQualifiedName(),
org.apache.servicecomb.foundation.common.utils.ExceptionUtils.getExceptionMessageWithoutTrace(e));
}
invocation.onBusinessMethodFinish();
invocation.onBusinessFinish();
response = processException(invocation, e);
}
return response;
}
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]