We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
下面两个方法很明显,一旦异常,在catch中会有个空指针异常
/** * 在服务调用之前拦截 * * @param ropRequestContext */ private void invokeBeforceServiceOfInterceptors(RopRequestContext ropRequestContext) { Interceptor tempInterceptor = null; try { if (interceptors != null && interceptors.size() > 0) { for (Interceptor interceptor : interceptors) {
interceptor.beforeService(ropRequestContext); //如果有一个产生了响应,则阻止后续的调用 if (ropRequestContext.getRopResponse() != null) { if (logger.isDebugEnabled()) { logger.debug("拦截器[" + interceptor.getClass().getName() + "]产生了一个RopResponse," + " 阻止本次服务请求继续,服务将直接返回。"); } return; } } } } catch (Throwable e) { ropRequestContext.setRopResponse(new ServiceUnavailableErrorResponse(ropRequestContext.getMethod(), ropRequestContext.getLocale(), e)); logger.error("在执行拦截器[" + tempInterceptor.getClass().getName() + "]时发生异常.", e); } } /** * 在服务调用之后,返回响应之前拦截 * * @param ropRequestContext */ private void invokeBeforceResponseOfInterceptors(RopRequestContext ropRequestContext) { Interceptor tempInterceptor = null; try { if (interceptors != null && interceptors.size() > 0) { for (Interceptor interceptor : interceptors) { interceptor.beforeResponse(ropRequestContext); } } } catch (Throwable e) { ropRequestContext.setRopResponse(new ServiceUnavailableErrorResponse(ropRequestContext.getMethod(), ropRequestContext.getLocale(), e)); logger.error("在执行拦截器[" + tempInterceptor.getClass().getName() + "]时发生异常.", e); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
下面两个方法很明显,一旦异常,在catch中会有个空指针异常
/**
* 在服务调用之前拦截
*
* @param ropRequestContext
*/
private void invokeBeforceServiceOfInterceptors(RopRequestContext ropRequestContext) {
Interceptor tempInterceptor = null;
try {
if (interceptors != null && interceptors.size() > 0) {
for (Interceptor interceptor : interceptors) {
The text was updated successfully, but these errors were encountered: