- Inside Macintosh: Programmer's Guide to MacApp / Part 1 - MacApp Theory and Architecture
- Chapter 6 - Scripting
Error Handling
MacApp's global TOSADispatcher object bottlenecks errors in the PreDispatchHandlerGlue and DispatchHandlerGlue methods, and reports them with the ReportDispatchError method. These methods are designed to always "do the right thing" to ensure that errors are handled correctly. The user never sees an alert unless the following statements are both true:
- The caller is not going to inform the user of an error.
- The caller allows the application to inform the user.
When you write code to handle Apple events, you should never display an error alert directly. When your code that handles Apple events detects an error, it should process the error by calling one of MacApp's failure routines, such as FailOSError or FailNonObject (see "MacApp Error-Checking Routines," beginning on page 562). The error will be caught by the TOSADispatcher object's error-handling bottleneck and handled appropriately.
© Apple Computer, Inc.
25 JUL 1996