Ticket #2354 (closed: fixed)

Opened 10 years ago

Last modified 5 years ago

Python exceptions should print their line number

Reported by: Peter Peterson Owned by: Peter Peterson
Priority: major Milestone: Iteration 27
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Martyn Gigg

Description

In python scripts the error message that is printed in the "Results Log" should print the line number and file that the python error occurred in. This would make it much easier to figure out what went wrong in python algorithms.

Change History

comment:1 Changed 10 years ago by Peter Peterson

  • Status changed from new to accepted
  • Owner set to Peter Peterson

comment:2 Changed 10 years ago by Peter Peterson

  • Status changed from accepted to verify
  • Resolution set to fixed

(In [9174]) Added full stack trace for python errors. Fixes #2354.

comment:3 Changed 10 years ago by Martyn Gigg

(In [9466]) Fix some more memory leaks in loading. Others eem out of our control for now. Re #2354

comment:4 Changed 10 years ago by Martyn Gigg

  • Status changed from verify to verifying
  • Tester set to Martyn Gigg

comment:5 Changed 10 years ago by Martyn Gigg

  • Status changed from verifying to closed

Tested with

class TestAlg(PythonAlgorithm):
	
	def PyInit(self):
		self.declareProperty("Name","",Direction=Direction.Input)
	
	def PyExec(self):
		s = self.getProperty("Name")
		mtd.sendLogMessage('Name is %s' % s)
		raise RuntimeError("Raising hell")
		
mtd.registerPyAlgorithm(TestAlg())

Confirmed that stack trace was printed to the log

comment:6 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 3201

Note: See TracTickets for help on using tickets.