shihaojun opened a new issue #9677:
URL: https://github.com/apache/dubbo/issues/9677


   suggest ExceptionFilter should't change the RuntimeException again
   
   // directly throw if it's checked exception
    if (!(exception instanceof RuntimeException) && (exception instanceof 
Exception)) {
     return;
   }
   //ellipsis some code
   // otherwise, wrap with RuntimeException and throw back to the client
   appResponse.setException(new 
RuntimeException(StringUtils.toString(exception)));
   ------------------
   on this code it change the Exception
   I don't know what purpose of change the Exception,especially when this 
Exception instanceof RuntimeException,It just wrap it again
   If you want to send some message by Exception,a instanceof  of 
RuntimeException is a good choice. 
   It don't need to declare on every method,but catch on the global exception 
handler
   For example,if you use java proxy,it auto generate a class like that if you 
has no exception appears in the signature:
   try {
               super.h.invoke(this, m3, (Object[])null);
           } catch (RuntimeException | Error var2) {
               throw var2;
           } catch (Throwable var3) {
               throw new UndeclaredThrowableException(var3);
           }


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