← Back to team overview

sikuli-driver team mailing list archive

[Question #230510]: Returning A Sikuli Error Message

 

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

To do my testing I run a series of driver scripts which in turn call individual test scripts which are defined as functions.  I use Try and Except in both the driver and called scripts to print the name of the script in which any errors occur.  However, I can't work out how to also return the error itself from the called script, such as I would get in the bottom info pane of the interface window, if running the script directly.

At the moment I am trying to move the scripts to another machine and operating system and it would be useful to know which images are not being found or recognised.  The only way I can do this at the moment is by commenting out the def, try and except lines in the scripts and running each script through individually, which is time-consuming because of having to change all the indentations.

I saw one answer on your site which said use print [Error], sys.exc_info()[0], str(sys.exc_info[1]).replace("\n", " ").  I am not sure of the syntax here, so don’t know if this format is correct in my situation.  Would a line printed in a called script be visible in the bottom info pane of the calling script? Also, I already have a variable called Error in my Except clean up routine.  Is this going to be a problem?

Finally, how would I place the error into a variable which I could then pass back to the calling scripts, if I wanted to do it that way?

I run 0.10.2.  I want to upgrade soon, but not just yet.


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