You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by "jinmeiliao (GitHub)" <gi...@apache.org> on 2019/02/13 22:40:17 UTC

[GitHub] [geode] jinmeiliao commented on issue #3187: DO NOT REVIEW Geode 6174 idempotency

I think we are making this change more complicated than it should be. IMHO, There should not be any changes in the LocatorClusterManagementService. This internal API would still throw EntityExistsException when creating entity the 2nd time, because that's what it is. We are only making "REST" service idempotent, then it's up to the rest controller to interpret this exception to its own purpose. The only change, I think, is in the the `ManagementControllerAdvice`, change several lines to:

```  @ExceptionHandler(EntityExistsException.class)
  public ResponseEntity<ClusterManagementResult> entityExists(final Exception e) {
    // no need to log the error stack. User only needs to know the message.
    return new ResponseEntity<>(new ClusterManagementResult(true, e.getMessage()),
        HttpStatus.OK);
  }```

[ Full content available at: https://github.com/apache/geode/pull/3187 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org