← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #670456]: General error handling

 

Question #670456 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/670456

RaiMan proposed the following answer:
Thanks for kind feedback.

--- Did not invoke the handler
I checked and have to admit you are right. Is fixed now.

--- exists() should not abort when coming back from FindFailed
I fixed this now.

This works:
Using 
FindFailed.setHandler(ffhandler)
takes care, that every Region created threafter inherits the setting (handler will be visited on FindFailed)

In Jython/Jruby scripting:
If you want this behaviour for the standard SCREEN object too, you either have tu issue a
use()
after the global setting or use 
setFindFailedHandler(ffhandler)

The latter one is the only to use, if you want the behaviour only for
the global SCREEN object.

Be aware:
If you do not want your script to abort after returning from the handler, you have to issue
event.setResponse(SKIP)
in the handler before the return.
Depending on what you have done in the handler, one of the other options RETRY or PROMPT might make sense as well.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.