tephra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anew <...@git.apache.org>
Subject [GitHub] incubator-tephra pull request #18: [TEPHRA-194] Make startShort() throw Ille...
Date Thu, 20 Oct 2016 22:55:10 GMT
Github user anew commented on a diff in the pull request:

    https://github.com/apache/incubator-tephra/pull/18#discussion_r84392263
  
    --- Diff: tephra-core/src/main/java/org/apache/tephra/distributed/TransactionServiceThriftClient.java
---
    @@ -112,7 +113,20 @@ public Transaction startShort() throws TException {
     
       public Transaction startShort(int timeout) throws TException {
         try {
    -      return TransactionConverterUtils.unwrap(client.startShortTimeout(timeout));
    +      return TransactionConverterUtils.unwrap(client.startShortWithTimeout(timeout));
    +    } catch (TGenericException e) {
    +      isValid.set(false);
    +      // currently, we only expect IllegalArgumentException here, if the timeout is invalid
    +      IllegalArgumentException actual;
    +      try {
    +        actual = (IllegalArgumentException)
    +          Class.forName(e.getOriginalExceptionClass())
    +            .getConstructor(String.class)
    +            .newInstance(e.getMessage());
    +      } catch (Throwable t) {
    --- End diff --
    
    Because we do not expect anything else than IllegalArgumentException? For now, I will
change the code to be more readable and expect exactly that.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message