nagappan
Joined: 01 Jan 2008 Posts: 8 Location: Mountain View
|
Posted: Tue Jan 01, 2008 2:49 pm Post subject: Exception handling |
|
|
Its always recommended to handle exception:
Script without exception handling
| Code: | click ("*-gedit", "btnFind") # Clicks find button in gedit window
|
Script with exception handling
| Code: | try:
click ("*-gedit", "btnFind") # Clicks find button in gedit window
except LdtpExecutionError, msg:
print "Failed", msg
raise LdtpExecutionError (str (msg))
|
Advantages of exception handling
Helpful for logging the cause for failure
|
|