Open JusFree opened 4 months ago
It looks like someone is trying to solve this problem https://github.com/apache/dubbo/pull/14417
看起来有人正在尝试解决这个问题#14417
There are some differences. #14417 deals with cross-language exceptions, while my issue concerns custom exceptions between Java services. In the ExceptionFilter, when the same exception is defined within the same directory as the API, it can be thrown directly. However, when the API and the exception class are not in the same package, the exception is uniformly wrapped as a RuntimeException.
看起来有人正在尝试解决这个问题#14417
There are some differences. #14417 deals with cross-language exceptions, while my issue concerns custom exceptions between Java services. In the ExceptionFilter, when the same exception is defined within the same directory as the API, it can be thrown directly. However, when the API and the exception class are not in the same package, the exception is uniformly wrapped as a RuntimeException.
You can submit a pr to try and fix the issue you're having.
请问后续有什么方案可以解决这个问题吗
请问后续有什么方案可以解决这个问题吗
目前时放在api目录下,他是可以抛出自定义异常的,之前看了源码如果要不限包抛出自定义异常的话需要自己定义白名单,侵入性有点大就没有去改造了。 路径大概如下:
Pre-check
Search before asking
Apache Dubbo Component
Java SDK (apache/dubbo)
Dubbo Version
3.2.13
Steps to reproduce this issue
Declared a custom interceptor using SPI as follows:
However, the exception returned by the caller is still wrapped in a RuntimeException.
What you expected to happen
Able to correctly retrieve the custom exception.
Anything else
No response
Are you willing to submit a pull request to fix on your own?
Code of Conduct