Repository: zeppelin
Updated Branches:
  refs/heads/master 5e37eed12 -> 514ba659b


[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


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

Branch: refs/heads/master
Commit: 514ba659bbe8706bccf539b09712362377bfd588
Parents: 5e37eed
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:35 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/514ba659/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 ff4626d..a3b7f8d 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
@@ -677,8 +677,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);
@@ -688,7 +689,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/514ba659/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