Repository: zeppelin
Updated Branches:
  refs/heads/branch-0.8 a30d190bd -> 28dc47da2


[HOTFIX] More proper error message when interpreter is not binded

### What is this PR for?
Minor fix for more proper error message when interpreter is not binded

### What type of PR is it?
[Bug Fix | Improvement ]

### Todos
* [ ] - Task

### What is the Jira issue?
* NO jira created

### How should this be tested?
* CI pass

### Screenshots (if appropriate)
Before
![screen shot 2018-03-14 at 10 13 50 
am](https://user-images.githubusercontent.com/164491/37381029-1e27ac9a-2776-11e8-9c2d-1c696aa07807.png)

After
![screen shot 2018-03-14 at 10 52 24 
am](https://user-images.githubusercontent.com/164491/37381033-20926466-2776-11e8-823d-211160bbcf76.png)

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Author: Jeff Zhang <zjf...@apache.org>

Closes #2865 from zjffdu/HOTFIX_INTP and squashes the following commits:

0a22913 [Jeff Zhang] [HOTFIX] More proper error message when interpreter is not 
binded

(cherry picked from commit 514ba659bbe8706bccf539b09712362377bfd588)
Signed-off-by: Jeff Zhang <zjf...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/28dc47da
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/28dc47da
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/28dc47da

Branch: refs/heads/branch-0.8
Commit: 28dc47da28a7b649193ff052e5bb9941855943c3
Parents: a30d190
Author: Jeff Zhang <zjf...@apache.org>
Authored: Wed Mar 14 10:53:28 2018 +0800
Committer: Jeff Zhang <zjf...@apache.org>
Committed: Wed Mar 14 12:26:50 2018 +0800

----------------------------------------------------------------------
 .../org/apache/zeppelin/interpreter/InterpreterSetting.java | 5 +++--
 .../main/java/org/apache/zeppelin/notebook/Paragraph.java   | 9 +++------
 2 files changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/28dc47da/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSetting.java
----------------------------------------------------------------------
diff --git 
a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSetting.java
 
b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSetting.java
index 6e51a52..b63c98a 100644
--- 
a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSetting.java
+++ 
b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSetting.java
@@ -676,8 +676,9 @@ public class InterpreterSetting {
   List<Interpreter> createInterpreters(String user, String interpreterGroupId, 
String sessionId) {
     List<Interpreter> interpreters = new ArrayList<>();
     List<InterpreterInfo> interpreterInfos = getInterpreterInfos();
+    Properties intpProperties = getJavaProperties();
     for (InterpreterInfo info : interpreterInfos) {
-      Interpreter interpreter = new RemoteInterpreter(getJavaProperties(), 
sessionId,
+      Interpreter interpreter = new RemoteInterpreter(intpProperties, 
sessionId,
           info.getClassName(), user, lifecycleManager);
       if (info.isDefaultInterpreter()) {
         interpreters.add(0, interpreter);
@@ -687,7 +688,7 @@ public class InterpreterSetting {
       LOGGER.info("Interpreter {} created for user: {}, sessionId: {}",
           interpreter.getClassName(), user, sessionId);
     }
-    interpreters.add(new ConfInterpreter(getJavaProperties(), 
interpreterGroupId, this));
+    interpreters.add(new ConfInterpreter(intpProperties, interpreterGroupId, 
this));
     return interpreters;
   }
 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/28dc47da/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java
----------------------------------------------------------------------
diff --git 
a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java 
b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java
index 23d2d47..57756b8 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java
@@ -367,14 +367,11 @@ public class Paragraph extends Job implements Cloneable, 
JsonSerializable {
         return true;
       }
     } catch (InterpreterNotFoundException e) {
-      String intpExceptionMsg =
-          getJobName() + "'s Interpreter " + getIntpText() + " not found";
-      RuntimeException intpException = new RuntimeException(intpExceptionMsg);
       InterpreterResult intpResult =
-          new InterpreterResult(InterpreterResult.Code.ERROR, 
intpException.getMessage());
-      setReturn(intpResult, intpException);
+          new InterpreterResult(InterpreterResult.Code.ERROR);
+      setReturn(intpResult, e);
       setStatus(Job.Status.ERROR);
-      throw intpException;
+      throw new RuntimeException(e);
     }
   }
 

Reply via email to