← Back to team overview

sikuli-driver team mailing list archive

[Question #162176]: User defined exceptions

 

New question #162176 on Sikuli:
https://answers.launchpad.net/sikuli/+question/162176

Hi! 

I want to define my own exception, is that possible? I have been reading through some python and jython documentation but would not be able to get it. 

I know that i should define a exception as a class, like this: 

class MyException(Exception):
    def __init__(self)
    +some more code

But how would be the best way to continue if I want to get my exception to work as the FindFailed exception? 

The reason I would like to use user defined excetions is that I would run a script where several images could be either be there or not. And I want to do different things according on what exception who is raised. Probably I could use the FindFailed exception, but then what to do when several exceptions is raised and everybody is refered to as find failed? 

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.