EarthChen opened a new issue #8363:
URL: https://github.com/apache/dubbo/issues/8363


   
   ### Environment
   
   * Dubbo version: 3.0.1
   * Operating System version: macos
   * Java version: 8
   
   ### Steps to reproduce this issue
   
   i  use custom exceptionFilter for return bizException ,
   ```java
   public class DubboExceptionFilter implements Filter, Filter.Listener {
   
       private static Logger log = 
LoggerFactory.getLogger(DubboExceptionFilter.class);
   
   
       @Override
       public Result invoke(Invoker<?> invoker, Invocation invocation) throws 
RpcException {
           return invoker.invoke(invocation);
       }
   
       @Override
       public void onResponse(Result appResponse, Invoker<?> invoker, 
Invocation invocation) {
        
                    // ...
                   // my customer exception
                   if (className.startsWith("com.test.excepiton")) {
                       return;
                   }
   
                   // directly throw if it's dubbo exception
                   if (exception instanceof RpcException) {
                       return;
                   }
   
                   // otherwise, wrap with RuntimeException and throw back to 
the client
                   appResponse.setException(new 
RuntimeException(StringUtils.toString(exception)));
               } catch (Throwable e) {
                   log.warn("Fail to ExceptionFilter when called by " + 
RpcContext.getServiceContext().getRemoteHost() + ". service: " + 
invoker.getInterface().getName() + ", method: " + invocation.getMethodName() + 
", exception: " + e.getClass().getName() + ": " + e.getMessage(), e);
               }
           }
       }
   }
   ```
   
   2.  The provider provides an interface
   ```java
   @Override
   public SetMealCreateResponse 
createSetMealByUserIdAndTeamId(SetMealCreateRequest setMealCreateRequest) {
       throw new BizRpcException(1111, "test");
   }
   ```
   
   ## use dubbo protocol
   
   
![image](https://user-images.githubusercontent.com/20179425/127333688-032ae0ec-cb2d-4a21-a5c8-889e3019efb4.png)
   
   
   ## use tri protocol
   
![image](https://user-images.githubusercontent.com/20179425/127333289-445d1b02-0dde-4539-a5eb-006935da8015.png)
   
   
   Pls. provide [GitHub address] to reproduce this issue.
   
   ### Expected Result
   
   use tri protocol should return real exception
   
   ### Actual Result
   
   return rpcException
   
   
   


-- 
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]

Reply via email to