Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 333231

Summary: [Interpreter] Exception handling for script engine
Product: [Modeling] EMFT.Henshin Reporter: Christian Krause <henshin.ck>
Component: InterpreterAssignee: Enrico Biermann <enrico>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Christian Krause CLA 2010-12-27 05:18:34 EST
Runtime errors that occur in the script engine are currently only printed to sysout. Instead thez should cause a runtime error in the interpreter. The easiest way to do this is to throw a RuntimeException which contains the causing ScriptException.

Also: it can happen that on some systems the script engine cannot be initialized. Currently this causes an NPE when the interpreter is trying to use the engine for the first time. I think there should be again a RuntimeException with an error like "Error initializing script engine" or something similar. This can be either checked when the scriptengine is initialized or when it is being used for the first time. The latter has the advantage that transformations that don't require a scriptengine can still be executed.
Comment 1 Enrico Biermann CLA 2011-01-06 07:59:20 EST
I added RuntimeExceptions to failed ScriptEngine evaluations.

As for initialization errors on the script engine itself, which systems have problems with initializing the engine?
Comment 2 Christian Krause CLA 2011-01-06 09:20:01 EST
I experienced this problem on my netbook running Gentoo. I haven't figured out yet why the engine is not found. Anyway, it can happen and if it does it is better to throw a runtime exception saying 'Error initializing script engine' than a NPE at some point during the execution.

(In reply to comment #1)
> I added RuntimeExceptions to failed ScriptEngine evaluations.
> 
> As for initialization errors on the script engine itself, which systems have
> problems with initializing the engine?
Comment 3 Enrico Biermann CLA 2011-02-24 03:48:41 EST
Already fixed