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/23 02:57:41 UTC
[GitHub] [shardingsphere] lanchengx opened a new pull request #12638: Reduce `unknownException` throws
lanchengx opened a new pull request #12638:
URL: https://github.com/apache/shardingsphere/pull/12638
Changes proposed in this pull request:
- Add handling of runtime exceptions
--
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
[GitHub] [shardingsphere] tristaZero merged pull request #12638: Reduce `unknownException` throws
Posted by GitBox <gi...@apache.org>.
tristaZero merged pull request #12638:
URL: https://github.com/apache/shardingsphere/pull/12638
--
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
[GitHub] [shardingsphere] lanchengx commented on a change in pull request #12638: Reduce `unknownException` throws
Posted by GitBox <gi...@apache.org>.
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
[GitHub] [shardingsphere] codecov-commenter commented on pull request #12638: Reduce `unknownException` throws
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #12638:
URL: https://github.com/apache/shardingsphere/pull/12638#issuecomment-925505649
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/12638?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#12638](https://codecov.io/gh/apache/shardingsphere/pull/12638?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3fa885a) into [master](https://codecov.io/gh/apache/shardingsphere/commit/77b1006ebd28b8ef73d42d6819099ab8658eee79?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (77b1006) will **increase** coverage by `0.00%`.
> The diff coverage is `73.76%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/12638/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/shardingsphere/pull/12638?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #12638 +/- ##
=========================================
Coverage 63.37% 63.38%
- Complexity 1327 1328 +1
=========================================
Files 2440 2440
Lines 37009 37050 +41
Branches 6405 6402 -3
=========================================
+ Hits 23456 23483 +27
- Misses 11648 11674 +26
+ Partials 1905 1893 -12
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/12638?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...ere/infra/metadata/schema/loader/SchemaLoader.java](https://codecov.io/gh/apache/shardingsphere/pull/12638/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvbG9hZGVyL1NjaGVtYUxvYWRlci5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...sphere/infra/optimize/ShardingSphereOptimizer.java](https://codecov.io/gh/apache/shardingsphere/pull/12638/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtb3B0aW1pemUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL29wdGltaXplL1NoYXJkaW5nU3BoZXJlT3B0aW1pemVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
| [.../customized/CustomizedOptimizerContextFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/12638/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtb3B0aW1pemUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL29wdGltaXplL2NvbnRleHQvY3VzdG9taXplZC9DdXN0b21pemVkT3B0aW1pemVyQ29udGV4dEZhY3RvcnkuamF2YQ==) | `0.00% <0.00%> (ø)` | |
| [...text/original/OriginalOptimizerContextFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/12638/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtb3B0aW1pemUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL29wdGltaXplL2NvbnRleHQvb3JpZ2luYWwvT3JpZ2luYWxPcHRpbWl6ZXJDb250ZXh0RmFjdG9yeS5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...ginal/props/OptimizerPropertiesBuilderFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/12638/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtb3B0aW1pemUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL29wdGltaXplL2NvbnRleHQvb3JpZ2luYWwvcHJvcHMvT3B0aW1pemVyUHJvcGVydGllc0J1aWxkZXJGYWN0b3J5LmphdmE=) | `0.00% <ø> (ø)` | |
| [...ginal/props/impl/H2OptimizerPropertiesBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/12638/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtb3B0aW1pemUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL29wdGltaXplL2NvbnRleHQvb3JpZ2luYWwvcHJvcHMvaW1wbC9IMk9wdGltaXplclByb3BlcnRpZXNCdWlsZGVyLmphdmE=) | `0.00% <ø> (ø)` | |
| [.../props/impl/MariaDBOptimizerPropertiesBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/12638/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtb3B0aW1pemUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL29wdGltaXplL2NvbnRleHQvb3JpZ2luYWwvcHJvcHMvaW1wbC9NYXJpYURCT3B0aW1pemVyUHJvcGVydGllc0J1aWxkZXIuamF2YQ==) | `0.00% <ø> (ø)` | |
| [...al/props/impl/MySQLOptimizerPropertiesBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/12638/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtb3B0aW1pemUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL29wdGltaXplL2NvbnRleHQvb3JpZ2luYWwvcHJvcHMvaW1wbC9NeVNRTE9wdGltaXplclByb3BlcnRpZXNCdWlsZGVyLmphdmE=) | `0.00% <ø> (ø)` | |
| [...rops/impl/OpenGaussOptimizerPropertiesBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/12638/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtb3B0aW1pemUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL29wdGltaXplL2NvbnRleHQvb3JpZ2luYWwvcHJvcHMvaW1wbC9PcGVuR2F1c3NPcHRpbWl6ZXJQcm9wZXJ0aWVzQnVpbGRlci5qYXZh) | `0.00% <ø> (ø)` | |
| [...l/props/impl/OracleOptimizerPropertiesBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/12638/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtb3B0aW1pemUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL29wdGltaXplL2NvbnRleHQvb3JpZ2luYWwvcHJvcHMvaW1wbC9PcmFjbGVPcHRpbWl6ZXJQcm9wZXJ0aWVzQnVpbGRlci5qYXZh) | `0.00% <ø> (ø)` | |
| ... and [43 more](https://codecov.io/gh/apache/shardingsphere/pull/12638/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/12638?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/12638?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [54aed2a...3fa885a](https://codecov.io/gh/apache/shardingsphere/pull/12638?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
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
[GitHub] [shardingsphere] RaigorJiang commented on pull request #12638: Reduce `unknownException` throws
Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on pull request #12638:
URL: https://github.com/apache/shardingsphere/pull/12638#issuecomment-925673305
Hi @tristaZero,
Please see if this improvement is necessary? I'm not sure this is valuable to users.
--
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
[GitHub] [shardingsphere] tristaZero commented on a change in pull request #12638: Reduce `unknownException` throws
Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #12638:
URL: https://github.com/apache/shardingsphere/pull/12638#discussion_r714713860
##########
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:
What's the main difference betweenen there two exception?
--
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