Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MOAR multi-catch

  • Loading branch information...
commit 06c1059b3e823598967869330917acc5c7112c3e 1 parent 0ef3bbe
@zznate authored
Showing with 10 additions and 39 deletions.
  1. +10 −39 src/main/java/org/usergrid/vx/experimental/IntraOp.java
View
49 src/main/java/org/usergrid/vx/experimental/IntraOp.java
@@ -372,10 +372,8 @@ public void execute(IntraReq req, IntraRes res, IntraState state, int i, Vertx v
IntraService.readCf(cf, finalResults, state);
}
res.getOpsRes().put(i,finalResults);
- } catch (ReadTimeoutException e) {
- res.setExceptionAndId(e.getMessage(), i);
- return;
- } catch (org.apache.cassandra.exceptions.UnavailableException | IsBootstrappingException | IOException e) {
+ } catch (ReadTimeoutException | org.apache.cassandra.exceptions.UnavailableException
+ | IsBootstrappingException | IOException e) {
res.setExceptionAndId(e.getMessage(), i);
return;
}
@@ -411,16 +409,8 @@ public void execute(IntraReq req, IntraRes res, IntraState state, int i, Vertx v
IntraService.readCf(cf, finalResults, state);
}
res.getOpsRes().put(i, finalResults);
- } catch (ReadTimeoutException e) {
- res.getOpsRes().put(i, e.getMessage());
- return;
- } catch (UnavailableException e) {
- res.getOpsRes().put(i, e.getMessage());
- return;
- } catch (IsBootstrappingException e) {
- res.getOpsRes().put(i, e.getMessage());
- return;
- } catch (IOException e) {
+ } catch (ReadTimeoutException | org.apache.cassandra.exceptions.UnavailableException
+ | IsBootstrappingException | IOException e) {
res.getOpsRes().put(i, e.getMessage());
return;
}
@@ -444,16 +434,9 @@ public void execute(IntraReq req, IntraRes res, IntraState state, int i, Vertx v
try {
StorageProxy.mutate(Arrays.asList(rm), state.consistency);
res.getOpsRes().put(i, "OK");
- } catch (WriteTimeoutException e) {
- res.setExceptionAndId(e.getMessage(), i);
- return;
- } catch (org.apache.cassandra.exceptions.UnavailableException e) {
- res.setExceptionAndId(e.getMessage(), i);
- return;
- } catch (OverloadedException e) {
+ } catch (WriteTimeoutException | org.apache.cassandra.exceptions.UnavailableException | OverloadedException e) {
res.setExceptionAndId(e.getMessage(), i);
- return;
- }
+ return;}
}
},
AUTOTIMESTAMP {
@@ -501,10 +484,7 @@ public void execute(IntraReq req, IntraRes res, IntraState state, int i, Vertx v
Processor p = null;
try {
p = (Processor) c.newInstance();
- } catch (InstantiationException e) {
- res.setExceptionAndId(e, i);
- return;
- } catch (IllegalAccessException e) {
+ } catch (InstantiationException | IllegalAccessException e) {
res.setExceptionAndId(e, i);
return;
}
@@ -540,10 +520,7 @@ public void execute(IntraReq req, IntraRes res, IntraState state, int i, Vertx v
Filter f = null;
try {
f = (Filter) c.newInstance();
- } catch (InstantiationException e) {
- res.setExceptionAndId(e, i);
- return;
- } catch (IllegalAccessException e) {
+ } catch (InstantiationException | IllegalAccessException e) {
res.setExceptionAndId(e, i);
return;
}
@@ -585,10 +562,7 @@ public void execute(IntraReq req, IntraRes res, IntraState state, int i, Vertx v
ResultMessage rm = null;
try {
rm = QueryProcessor.process((String) op.getOp().get("query"), state.consistency, queryState);
- } catch (RequestExecutionException e) {
- res.setExceptionAndId(e, i);
- return;
- } catch (RequestValidationException e) {
+ } catch (RequestExecutionException | RequestValidationException e) {
res.setExceptionAndId(e, i);
return;
}
@@ -627,10 +601,7 @@ public void execute(IntraReq req, IntraRes res, IntraState state, int i, Vertx v
MultiProcessor p = null;
try {
p = (MultiProcessor) c.newInstance();
- } catch (InstantiationException e) {
- res.setExceptionAndId(e, i);
- return;
- } catch (IllegalAccessException e) {
+ } catch (InstantiationException | IllegalAccessException e) {
res.setExceptionAndId(e, i);
return;
}
Please sign in to comment.
Something went wrong with that request. Please try again.