Author jamesmudd
Recipients jamesmudd
Date 2017-12-08.13:18:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
When a PyException is created the detailMessage field of the Java exception is not filled in. This is probamatic when you use a Java logging framework and a PyException is caught. The detailMessage is used to build the logging output by calling e.getMessage() on the exception.

See the attached code which illiterates the issue. The output is:
    Exception happened in script: null
    Exception happened in script: NameError: name 's' is not defined in <script> at line number 1

It also shows how this is handled differently if using the python script engine. There the message is filled by calling Py.formatException(type, value) when the ScriptException is constructed.

I propose this could be added to the PyException constructor to initialise the detailMessage, I will create a pull request to do that.

In general though I think it might be better to refactor PyException to be immutable, which make sense for an Exception as it should capture the state when its thrown and can't be modified after that. I will look into that as a separate pull request.
Date User Action Args
2017-12-08 13:18:19jamesmuddsetrecipients: + jamesmudd
2017-12-08 13:18:19jamesmuddsetmessageid: <>
2017-12-08 13:18:18jamesmuddlinkissue2650 messages
2017-12-08 13:18:17jamesmuddcreate