narendly commented on a change in pull request #788: WIP: Implement request
forwarding for ZkRoutingDataWriter
URL: https://github.com/apache/helix/pull/788#discussion_r382336848
##########
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:
You could let this IllegalStateException float up all the way to the
servlet..
For instance, for uncaught exceptions, the servlet container usually catch
the Exception, logs it and returns http status 500.
Just make sure MetadataStoreDirectory logs the exception properly.
----------------------------------------------------------------
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]