aplex commented on a change in pull request #2993:
URL: https://github.com/apache/incubator-gobblin/pull/2993#discussion_r428915654



##########
File path: 
gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigV2ResourceLocalHandler.java
##########
@@ -81,7 +83,7 @@ public CreateKVResponse createFlowConfig(FlowConfig 
flowConfig, boolean triggerL
     } else if 
(Boolean.parseBoolean(responseMap.getOrDefault(ServiceConfigKeys.COMPILATION_SUCCESSFUL,
 new AddSpecResponse<>("false")).getValue().toString())) {
       httpStatus = HttpStatus.S_201_CREATED;
     } else {
-      httpStatus = HttpStatus.S_400_BAD_REQUEST;
+      throw new RestLiServiceException(HttpStatus.S_400_BAD_REQUEST, "Flow was 
not compiled successfully");

Review comment:
       What are the next steps for the user here? Should he check the flow 
properties (we can point to the list of allowed properties), should he file a 
ticket and ask GaaS engineers to fix the issue? Also, do we have additional 
details on why the compilation was unsuccessful and what specific place had a 
problem?

##########
File path: 
gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowExecutionResource.java
##########
@@ -65,8 +66,11 @@ public FlowExecutionResource() {}
    */
   @Override
   public FlowExecution get(ComplexResourceKey<FlowStatusId, EmptyRecord> key) {
-    // this returns null to raise a 404 error if flowStatus is null
-    return convertFlowStatus(getFlowStatusFromGenerator(key, 
this._flowStatusGenerator));
+    FlowExecution flowExecution = 
convertFlowStatus(getFlowStatusFromGenerator(key, this._flowStatusGenerator));
+    if (flowExecution == null) {
+      throw new RestLiServiceException(HttpStatus.S_404_NOT_FOUND, "No flow 
execution found for flowStatusId " + key.getKey());

Review comment:
       When can this happen? Was the wrong flow id provided and user needs to 
check it, or the flows can get cleaned up/deleted after some period of time? 
Can it be the problem with permissions that he does not see the flow?




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to