LNS Home
Script Debugger
Download & Buy
x Explore
x Edit
x Run & Debug
x Deploy
What's New In 4.5
bullet Documentation
bullet Blog Posts
My SD Story
Software Updates
 
4.0.9 Update
3.0.9 Update
bullet 2.0.5 Update
x Free Downloads
 
XML Tools
XSLT Tools
x Property List Tools
x List & Record Tools
Register Your Copy of Script Debugger
Join the Script Debugger Mailing List
x AppleScript/ Scripting Links
Products
x Script Debugger 4.5
Site Contents
bullet Mark’s Blog
Product Registration
Bug Reporting
x Freeware
Contacting Us

SD4 Headling


image

Exceptions

image

An exception is a runtime error, and you can determine whether a runtime error should cause a pause when debugging, like a breakpoint.

Distinguish between a handled runtime error and an unhandled runtime error. A handled runtime error is an error that occurs within a try block. It would not normally cause any break in the action, because AppleScript will just call the on error clause if there is one, or just abandon the try block and continue execution after the block. An unhandled runtime error, on the other hand, causes execution to abort entirely, so there is no issue about pausing there — the script will do more than pause, it will stop.

To pause at handled runtime errors:

  • Choose Script > Break on Exceptions. If the menu item is checked, we will pause handled runtime errors. Alternatively, there is also an optional toolbar icon you can add to the script window toolbar; the icon toggles its state to show whether we’re going to break on exceptions or not.
imageimage

If Break on Exceptions is checked, a handled runtime error causes a pause when encountered in debug mode. Execution pauses at the line where the runtime error was encountered, before the error is thrown, and variables and expressions are evaluated at that point.

To learn what the error was:

  • Look at the bottom of the result pane. The error message is displayed there.
image
  • Choose Script > Show Last Error, or click the red arrow at the point where the error occurred. This summons the normal error dialog. (You can also add a Show Last Error button to the script window’s toolbar.)

If Break on Exceptions is unchecked, then a handled runtime error does not cause any pause. However, you can still learn, during any pause after the error is encountered (but before some other runtime error is encountered), where the error was, by choosing Search > Go to Last Error, and what the error was, by choosing Script > Show Last Error.



Explore | Edit | Run & Debug | Deploy | What's New In 4.5 | My SD Story


Copyright © 1998-2009 Late Night Software Ltd. - All Rights Reserved.