wxbty commented on code in PR #11088:
URL: https://github.com/apache/dubbo/pull/11088#discussion_r1107018616
##########
dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/support/header/HeaderExchangeHandler.java:
##########
@@ -82,15 +87,31 @@ void handleRequest(final ExchangeChannel channel, Request
req) throws RemotingEx
Response res = new Response(req.getId(), req.getVersion());
if (req.isBroken()) {
Object data = req.getData();
+ Throwable error = req.getError();
String msg;
if (data == null) {
msg = null;
- } else if (data instanceof Throwable) {
- msg = StringUtils.toString((Throwable) data);
} else {
msg = data.toString();
}
+
+ if (error != null) {
+ msg = StringUtils.toString(error);
+ // Give ExceptionProcessors a chance to retry request handle
or custom exception information.
+ String exPs =
ApplicationModel.defaultModel().getCurrentConfig().getParameters().get(EXCEPTION_PROCESSOR_KEY);
+ if (StringUtils.isNotBlank(exPs)) {
+ ExtensionLoader<ExceptionProcessor> extensionLoader =
ApplicationModel.defaultModel().getDefaultModule().getExtensionLoader(ExceptionProcessor.class);
+ ExceptionProcessor expProcessor =
extensionLoader.getOrDefaultExtension(exPs);
Review Comment:
use System.getProperty instead
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]