NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug.

The Fiji project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Bug 161 - Script editor reports useless error messages
Script editor reports useless error messages
Status: RESOLVED FIXED
Product: Fiji
Classification: Unclassified
Component: Plugins
unspecified
PC Windows
: P4 normal
Assigned To: ImageJ Bugs Mailing List
Depends on:
Blocks:
 
Reported: 2010-04-10 19:41 CDT by Jean-Yves Tinevez
Modified: 2010-05-24 20:52 CDT
1 user (show)

See Also:

Description Jean-Yves Tinevez 2010-04-10 19:41:36 CDT
The script editor does not report useful error message. For instance, using this jython code, which calls a non-existing method:00

imp = WindowManager.getCurrentImage()
IJ.write(imp.getPloumPloum())

The script editor reports the following trace:

Started New_.py at Sat Apr 10 19:38:04 CEST 2010
org.python.core.PyException: null
	 at org.python.core.PyException.fillInStackTrace(PyException.java:70)
	 at java.lang.Throwable.<init>(Throwable.java:181)
	 at java.lang.Exception.<init>(Exception.java:29)
	 at java.lang.RuntimeException.<init>(RuntimeException.java:32)
	 at org.python.core.PyException.<init>(PyException.java:46)
	 at org.python.core.PyException.<init>(PyException.java:43)
	 at org.python.core.PyException.<init>(PyException.java:61)
	 at org.python.core.Py.AttributeError(Py.java:145)
	 at org.python.core.PyObject.noAttributeError(PyObject.java:936)
	 at org.python.core.PyObject.object___getattribute__(PyObject.java:3690)
	 at org.python.core.PyObject$object___getattribute___exposer.__call__(null:-1)
	 at org.python.core.PyObjectDerived.__findattr_ex__(PyObjectDerived.java:993)
	 at org.python.core.PyObject.__getattr__(PyObject.java:929)
	 at org.python.pycode._pyx5.f$0(<iostream>:2)
	 at org.python.pycode._pyx5.call_function(<iostream>:-1)
	 at org.python.core.PyTableCode.call(PyTableCode.java:165)
	 at org.python.core.PyCode.call(PyCode.java:18)
	 at org.python.core.Py.runCode(Py.java:1204)
	 at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:200)
	 at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:195)
	 at Jython.Refresh_Jython_Scripts.runScript(Refresh_Jython_Scripts.java:66)
	 at fiji.scripting.TextEditor$10.execute(TextEditor.java:1242)
	 at fiji.scripting.TextEditor$Executer$1.run(TextEditor.java:1093)


It is very hard to find a clue about what is the error in this text clutter.
If the same code is run within the jython interpreter, we get:

Traceback (most recent call last):
  File "<string>", line 2, in <module>
AttributeError: 'ij.ImagePlus' object has no attribute 'getPloumPloum'

which we can use to debug our code.





Information about your version of Java - this information is useful for the Fiji developers:
  os.arch => amd64
  os.name => Windows Vista
  os.version => 6.0
  java.version => 1.6.0_16
  java.vendor => Sun Microsystems Inc.
  java.runtime.name => Java(TM) SE Runtime Environment
  java.runtime.version => 1.6.0_16-b01
  java.vm.name => Java HotSpot(TM) 64-Bit Server VM
  java.vm.version => 14.2-b01
  java.vm.vendor => Sun Microsystems Inc.
  java.vm.info => mixed mode
  java.awt.graphicsenv => sun.awt.Win32GraphicsEnvironment
  java.specification.name => Java Platform API Specification
  java.specification.version => 1.6
  sun.cpu.endian => little
  sun.desktop => windows
  file.separator => \
Comment 1 Jean-Yves Tinevez 2010-05-24 19:17:53 CDT
Johannes Schindelin fixed this while working on the script editor. 
Error message are now clean and clear.
Comment 2 Albert Cardona 2010-05-24 20:52:09 CDT
Roger that, I've seen it too. Nice!