kimmking commented on a change in pull request #4825: orchestration mode code 
optimization .
URL: 
https://github.com/apache/incubator-shardingsphere/pull/4825#discussion_r394214545
 
 

 ##########
 File path: 
sharding-orchestration/sharding-orchestration-core/sharding-orchestration-core-common/src/main/java/org/apache/shardingsphere/orchestration/core/common/CenterType.java
 ##########
 @@ -41,6 +42,8 @@
      * @return OrchestrationType enum, return {@code null} if not found
      */
     public static CenterType findByValue(final String value) {
-        return Arrays.stream(CenterType.values()).filter(each -> 
each.getValue().equals(value)).findFirst().get();
+        return Arrays.stream(CenterType.values())
+                .filter(each -> each.getValue().equals(value)).findFirst()
+                .orElseThrow(() -> new OrchestrationException("now only 
support :{},{}", "registry_center", "config_center"));
 
 Review comment:
   good.
   but static field referred better than literal string.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to