You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@submarine.apache.org by GitBox <gi...@apache.org> on 2020/10/16 07:26:28 UTC

[GitHub] [submarine] ByronHsu opened a new pull request #436: SUBMARINE-661. Clarify duplicate experiment error

ByronHsu opened a new pull request #436:
URL: https://github.com/apache/submarine/pull/436


   ### What is this PR for?
   A few sentences describing the overall goals of the pull request's commits.
   First time? Check out the contributing guide - https://submarine.apache.org/contribution/contributions.html
   When we send an experiment POST request that has the same name as the previous ones, it will raise an error. However, the error message does not explain the error clearly, it only says that there is a Conflict. (as the following)
   
   ```
   {
     "status": "CONFLICT",
     "code": 409,
     "success": null,
     "message": "Conflict",
     "result": null,
     "attributes": {}
   }
   ```
   To let users understand the cause of the error better, I change the message from "Conflict" to "Duplicated experiment".
   
   ```
   { 
     "status": "CONFLICT",
     "code": 409,
     "success": null,
     "message": "Duplicated Experiment",
     "result": null,
     "attributes": {} 
   }
    
   ```
   
   ### What type of PR is it?
   [ Improvement]
   
   ### Todos
   * [ ] - Task
   
   ### What is the Jira issue?
   https://issues.apache.org/jira/browse/SUBMARINE-662
   
   ### How should this be tested?
   * First time? Setup Travis CI as described on https://submarine.apache.org/contribution/contributions.html#continuous-integration
   * Strongly recommended: add automated unit tests for any new or changed behavior
   * Outline any manual steps to test the PR here.
   
   ### Screenshots (if appropriate)
   
   ### Questions:
   * Does the licenses files need update? Yes/No
   * Is there breaking changes for older versions? Yes/No
   * Does this needs documentation? Yes/No
   


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



[GitHub] [submarine] asfgit closed pull request #436: SUBMARINE-662. Clarify duplicate experiment error

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #436:
URL: https://github.com/apache/submarine/pull/436


   


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



[GitHub] [submarine] pingsutw commented on a change in pull request #436: SUBMARINE-662. Clarify duplicate experiment error

Posted by GitBox <gi...@apache.org>.
pingsutw commented on a change in pull request #436:
URL: https://github.com/apache/submarine/pull/436#discussion_r506214355



##########
File path: submarine-server/server-core/src/main/java/org/apache/submarine/server/rest/ExperimentRestApi.java
##########
@@ -259,6 +259,7 @@ public Response getLog(@PathParam(RestConstants.ID) String id) {
   }
 
   private Response parseExperimentServiceException(SubmarineRuntimeException e) {
-    return new JsonResponse.Builder<String>(e.getCode()).message(e.getMessage()).build();
+    return new JsonResponse.Builder<String>(e.getCode())
+      .message(e.getMessage().equals("Conflict") ? "Duplicated Experiment" : e.getMessage()).build();

Review comment:
       ```suggestion
         .message(e.getMessage().equals("Conflict") ? "Duplicated experiment name" : e.getMessage()).build();
   ```




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