You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/09/24 02:00:53 UTC

[GitHub] [shardingsphere] lanchengx commented on a change in pull request #12638: Reduce `unknownException` throws

lanchengx commented on a change in pull request #12638:
URL: https://github.com/apache/shardingsphere/pull/12638#discussion_r715267495



##########
File path: shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/err/MySQLErrPacketFactory.java
##########
@@ -116,6 +116,9 @@ public static MySQLErrPacket newInstance(final Exception cause) {
         if (cause instanceof ScalingJobNotFoundException) {
             return new MySQLErrPacket(1, CommonErrorCode.SCALING_JOB_NOT_EXIST, ((ScalingJobNotFoundException) cause).getJobId());
         }
+        if (cause instanceof RuntimeException) {
+            return new MySQLErrPacket(1, CommonErrorCode.RUNTIME_EXCEPTION, cause.getMessage());
+        }
         return new MySQLErrPacket(1, CommonErrorCode.UNKNOWN_EXCEPTION, cause.getMessage());

Review comment:
       There is no difference between the two, except that the display on the client side has changed from `unknown exception` to `runtime exception`.
   It mainly solves the `unknown exception` that appeared in the last poc.




-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org