pkuwm commented on a change in pull request #788: WIP: Implement request
forwarding for ZkRoutingDataWriter
URL: https://github.com/apache/helix/pull/788#discussion_r382319817
##########
File path:
helix-rest/src/main/java/org/apache/helix/rest/server/resources/metadatastore/MetadataStoreDirectoryAccessor.java
##########
@@ -90,9 +90,13 @@ public Response getAllMetadataStoreRealms() {
@Path("/metadata-store-realms/{realm}")
public Response addMetadataStoreRealm(@PathParam("realm") String realm) {
try {
- _metadataStoreDirectory.addMetadataStoreRealm(_namespace, realm);
+ if (!_metadataStoreDirectory.addMetadataStoreRealm(_namespace, realm)) {
+ return serverError();
+ }
} catch (IllegalArgumentException ex) {
return notFound(ex.getMessage());
+ } catch (IllegalStateException ex) {
+ return serverError();
Review comment:
If that’s the case, I would put it in addMetadatStoreRealm or a proper
place, but not here in this endpoint logic. It is not endpoint logic’s
responsibility to process such exception.
----------------------------------------------------------------
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]