[ZEPPELIN-2175] Jdbc interpreter sometime doesn't show detailed error message
### What is this PR for?
Zeppelin's JDBC interpreter sometimes doesn't show detailed error message on
the notebook ui. It shows only plain "ERROR" text near run button in case of
failure. User has to check JDBC interpreter log file in order to see a detailed
error message.
This is mostly in case of incompatible JAR and I see errors mentioned below;
```
java.lang.NoSuchMethodError:
org.apache.curator.utils.ZKPaths.fixForNamespace(Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/String;
at
org.apache.curator.framework.imps.NamespaceImpl.fixForNamespace(NamespaceImpl.java:82)
```
```
java.lang.NoSuchMethodError:
org.apache.hive.service.auth.HiveAuthFactory.getSocketTransport(Ljava/lang/String;II)Lorg/apache/hive/org/apache/thrift/transport/TTransport;
at
org.apache.hive.jdbc.HiveConnection.createBinaryTransport(HiveConnection.java:447)
```
Hence, IMO instead of catch -> Exception; we should use catch ->Throwable.
### What type of PR is it?
[Improvement]
### What is the Jira issue?
* [ZEPPELIN-2175](https://issues.apache.org/jira/browse/ZEPPELIN-2175)
### How should this be tested?
Use any incompatible in interpreter dependency, which would throw Error instead
of Exception.
### Screenshots (if appropriate)
### Questions:
* Does the licenses files need update? N/A
* Is there breaking changes for older versions? N/A
* Does this needs documentation? N/A
Author: Prabhjyot Singh <[email protected]>
Closes #2122 from prabhjyotsingh/ZEPPELIN-2175 and squashes the following
commits:
666ce8d [Prabhjyot Singh] use Throwable instead of Exception
(cherry picked from commit d0fc54bc782c9cc6bc9a5dda2d8ca92b46cc66c7)
Signed-off-by: Prabhjyot Singh <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/ae45495c
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/ae45495c
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/ae45495c
Branch: refs/heads/branch-0.7
Commit: ae45495cf05d1f35980da66037dc9b51db0647bd
Parents: 7998dd2
Author: Prabhjyot Singh <[email protected]>
Authored: Sat Mar 11 11:31:49 2017 +0530
Committer: Prabhjyot Singh <[email protected]>
Committed: Thu Mar 16 15:48:41 2017 +0530
----------------------------------------------------------------------
jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/zeppelin/blob/ae45495c/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java
----------------------------------------------------------------------
diff --git a/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java
b/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java
index 0f6ebad..4051398 100644
--- a/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java
+++ b/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java
@@ -621,7 +621,7 @@ public class JDBCInterpreter extends Interpreter {
} catch (SQLException e) { /*ignored*/ }
}
getJDBCConfiguration(user).removeStatement(paragraphId);
- } catch (Exception e) {
+ } catch (Throwable e) {
if (e.getCause() instanceof TTransportException &&
Throwables.getStackTraceAsString(e).contains("GSS") &&
getJDBCConfiguration(user).isConnectionInDBDriverPoolSuccessful(propertyKey)) {