← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #230510]: Returning A Sikuli Error Message

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
sys.exc_info is a tuple of 3 values:

(type, value, traceback) = sys.exc_info

where:
- type is the exception class (FindFailed in case image not found exception)
- value is the exception object
- traceback is a trace back object containing the stack trace (module traceback)

So you should start with a simple:

try:
    # some code
except:
    # some code maybe
    print "Got an exception:", sys.exc_info[0], " --- saying:", sys.exc_info[1]

Have a look at the output and then decide, wether additional formatting
is necessary.

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