Re: [Sikuli-driver] [Question #230510]: Printing the exception information in a catch block
Question #230510 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/230510 sandra hulme posted a new comment: Thanks very much for the working example. Sorry for the delay in acknowledging this, but I have been side tracked onto another activity for a couple of weeks or so. -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #230510]: Printing the exception information in a catch block
Question #230510 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/230510 Mark Weisler posted a new comment: The working script below illustrates some of how sys.exc_info works. # script: sys.exc_info explorer # Mark Weisler # 11 June 2013 # our goal is to create an error condition, save error to a variable or a database # Sikuli version X-1.0rc3 on OS X 10.6.8 try: f = open('sometestfile2.txt', 'r')# make sure this file does not exist to trigger an error, which we want to do f.close() # just in case the file did exist except: # some code maybe here print Got an exception:, sys.exc_info()[0], --- saying:, sys.exc_info()[1] print 0 is: , sys.exc_info()[0] print 1 is: , sys.exc_info()[1] ErrMsg = sys.exc_info()[1] print ErrMsg is: , ErrMsg # could be logged or stored in a database print Finishing execution... -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #230510]: Printing the exception information in a catch block
Question #230510 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/230510 Status: Answered = Solved sandra hulme confirmed that the question is solved: Thanks RaiMan, that solved my question. -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp