You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by "Peng Cheng (JIRA)" <ji...@apache.org> on 2016/09/05 22:45:20 UTC

[jira] [Created] (ZEPPELIN-1412) Python interpreter cannot handle Exception that has multi-line message

Peng Cheng created ZEPPELIN-1412:
------------------------------------

             Summary: Python interpreter cannot handle Exception that has multi-line message
                 Key: ZEPPELIN-1412
                 URL: https://issues.apache.org/jira/browse/ZEPPELIN-1412
             Project: Zeppelin
          Issue Type: Bug
          Components: python-interpreter
    Affects Versions: 0.7.0
         Environment: ubuntu 16.04 + python 2.7.12
            Reporter: Peng Cheng


Python interpreter can only catch exception according to last line output, this will cause the following test case to fail:

```
  @Test
  public void multiRowErrorFails() {
    //given
    PythonInterpreter realPython = new PythonInterpreter(
            PythonInterpreterTest.getPythonTestProperties());
    realPython.open();

    //when
    String QQQ = "\"\"\"\n";
    String code = "raise Exception (\n" +
            QQQ +
            "wrong\n" +
            "syntax\n" +
            QQQ +
            ")";
    InterpreterResult ret = realPython.interpret(code, null);

    //then
    assertNotNull("Interpreter returned 'null'", ret);
    //System.out.println("\nInterpreter response: \n" + ret.message());
    assertEquals(InterpreterResult.Code.ERROR, ret.code());
    assertTrue(ret.message().length() > 0);
  }
```

Please advice how to fix/bypass this error. (using stderr stream?)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)