Github user maryannxue commented on a diff in the pull request: https://github.com/apache/phoenix/pull/215#discussion_r82879380 --- 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 -- Thanks for the modification, @lomoree! It think it's fine to go for the deepest SQLException. But meanwhile I'm not sure if we should catch RuntimeException as well and then either unwrap it if we can find an inner SQLException or wrap it if not. @JamesRTaylor Any idea?
--- 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. ---