Important: The information in this document is obsolete and should not be used for new development.
Error Handling
MacApp's globalTOSADispatcherobject bottlenecks errors in thePreDispatchHandlerGlueandDispatchHandlerGluemethods, and reports them with theReportDispatchErrormethod. 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:
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
- The caller is not going to inform the user of an error.
- The caller allows the application to inform the user.
FailOSErrororFailNonObject(see "MacApp Error-Checking Routines," beginning on page 562). The error will be caught by theTOSADispatcherobject's error-handling bottleneck and handled appropriately.