Ticket #2354 (closed: fixed)
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
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
Note: See
TracTickets for help on using
tickets.