← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #172177]: Customized Error Messages / Hide Code in Error Message

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
--- you say: Can i have try and catch for the complete program, i mean
the try should start with the beginning and at the end the program
should have catch, so if anything happens anywhere it should show error
message

yes, you can do that.

-- you say: In VB we use msgbox err.description to show what error
happened, how can i do it in sikuli, or i have to give it a customized
message?

using:
try:
    # here comes your code
except:
    print sys.exc_info()[0], sys.exc_info()[1] 

would print out the error information. So use sys.exc_info() as you like
(e.g. with popup())

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