Github user JamesRTaylor commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/215#discussion_r82912355
  
    --- Diff: 
phoenix-core/src/main/java/org/apache/phoenix/calcite/CalciteUtils.java ---
    @@ -1115,4 +1115,15 @@ public static Object convertSqlLiteral(SqlLiteral 
literal, PhoenixRelImplementor
                         + " to its object type.", ex);
             }
         }
    +
    +    public static SQLException unwrapSqlException(SQLException root){
    +        Exception e = root;
    +        while(e.getCause() != null){
    +            e = (Exception) e.getCause();
    +            if(e instanceof SQLException){
    +                root = (SQLException) e;
    +            }
    +        }
    +        return root;
    +    }
    --- End diff --
    
    Yes, we'd definitely want to catch RuntimeException and look for a nested 
SQLException. I'd stop at the first SQLException we find and throw that one.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to