[1.0.1] Try/Catch for Error Handling in Sikuli?
I am trying to implement a try block that will run a workflow, but if some error pops up at any point during that workflow take a screenshot of the entire screen and exit the script gracefully...
I've tried the try/catch in multiple ways. Its only working for me if the error popup happens at the beginning of the workflow. If the error popup occurs at some midpoint in the workflow, Sikuli eventually fails with the FindFailed img error...
Here are two examples of code I've tried:
try:
wait(3)
while not exists(
except "ErrorScreensho
print ip, username, pwd
return 0
-------
try:
wait(3)
while not exists(
except FindFailed:
print ip, username, pwd
return 0
*** in the except FindFailed case I get a global name not defined error...
Any help is appreciated.
Thanks
Jennifer
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Jennifer Coleman for more information if necessary.