Sikuli 1.1.3: How to display the code of the line which threw the error.

Asked by Ron Turrentine on 2018-10-19

In a script that I wrote, I have exception handling which logs the error information for review later. I would like to include the actual code that is located on the line which threw the error. Is there an efficient way of doing that? I have tried opening up the actual .PY file and pulling the line # which errored from it, but that is not working well (getting an maximum recursion depth error when I do). Is there a better way?

I appreciate any recommendations!

Thanks,

Ron Turrentine

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2018-10-19
Last reply:
2018-10-19
RaiMan (raimund-hocke) said : #1

You have to dive into the Python exception handling about exec_info() and the traceback module.

Can you help with this problem?

Provide an answer of your own, or ask Ron Turrentine for more information if necessary.

To post a message you must log in.