Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update DefaultProvider.java #501

Merged
merged 3 commits into from
Aug 8, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,21 @@ public Response invoke(Request request) {
response.setValue(value);
} catch (Exception e) {
if (e.getCause() != null) {
LoggerUtil.error("Exception caught when method invoke: " + e.getCause());
response.setException(new MotanBizException("provider call process error", e.getCause()));
} else {
response.setException(new MotanBizException("provider call process error", e));
}
//服务发生错误时,显示详细日志
LoggerUtil.error("Exception caught when during method invocation. request:" + request.toString(), e);
} catch (Throwable t) {
// 如果服务发生Error,将Error转化为Exception,防止拖垮调用方
if (t.getCause() != null) {
response.setException(new MotanServiceException("provider has encountered a fatal error!", t.getCause()));
} else {
response.setException(new MotanServiceException("provider has encountered a fatal error!", t));
}

//对于Throwable,也记录日志
LoggerUtil.error("Exception caught when during method invocation. request:" + request.toString(), t);
}
// 传递rpc版本和attachment信息方便不同rpc版本的codec使用。
response.setRpcProtocolVersion(request.getRpcProtocolVersion());
Expand Down