akshayrai commented on a change in pull request #4419: [TE] Fix exception 
handling - Propagate and display the error message/exception on frontend
URL: https://github.com/apache/incubator-pinot/pull/4419#discussion_r302672546
 
 

 ##########
 File path: 
thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/validators/DetectionConfigValidator.java
 ##########
 @@ -72,20 +72,15 @@ public DetectionConfigValidator(DataProvider provider) {
    * Validate the pipeline by loading and initializing components
    */
   private void semanticValidation(DetectionConfigDTO detectionConfig) {
-    try {
-      // backup and swap out id
-      Long id = detectionConfig.getId();
-      detectionConfig.setId(-1L);
-
-      // try to load the detection pipeline and init all the components
-      this.loader.from(provider, detectionConfig, 0, 0);
-
-      // set id back
-      detectionConfig.setId(id);
-    } catch (Exception e){
-      // exception thrown in validate pipeline via reflection
-      throw new IllegalArgumentException("Semantic error: " + 
e.getCause().getMessage());
 
 Review comment:
   We would catch re-throw only if we add some additional information that can 
help us debug. But there we are simply changing the exception type without 
enriching the message.
   
   Without the catch, the exception will be propagated up and handled in 
YamlResource.  

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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to