Important: The information in this document is obsolete and should not be used for new development.
Error Handling
MacApp's globalTOSADispatcher
object bottlenecks errors in thePreDispatchHandlerGlue
andDispatchHandlerGlue
methods, and reports them with theReportDispatchError
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:
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.
FailOSError
orFailNonObject
(see "MacApp Error-Checking Routines," beginning on page 562). The error will be caught by theTOSADispatcher
object's error-handling bottleneck and handled appropriately.