Error Handler Reference (Legacy)

Framework
CoreServices/CoreServices.h
Declared in
IOMacOSTypes.h
MacErrors.h
MacTypes.h

Overview

In Mac OS 9, Error Handler provides a system service that displays system alerts seen during startup, and assumes control when certain low-level errors occur. For detailed information, see the chapter “System Error Handler” in Inside Macintosh: Operating System Utilities. A PDF version of this chapter is available at http://developer.apple.com/documentation/mac/pdf/Operating_System_Utilities/pdf.html.

The header MacErrors.h defines result codes that are used by many Carbon functions to indicate their return status. Developers can also define custom result codes for their own applications, using the range 1000 through 9999 inclusive (Apple reserves all values outside of this range for internal use.) For more information, see Technical Q&A OV02 at http://developer.apple.com/qa/ov/ov02.html.

Data Types

OSErr

A numeric code used in Carbon to indicate the return status of a function.

typedef SInt16 OSErr;
Discussion

The system software sometimes uses error codes to inform an application that a requested service is not possible. Many functions return a result code of type OSErr that indicates whether the function completed successfully, and if not, what the reason for failure was.

Availability
  • Available in OS X v10.0 and later.
Declared In
IOMacOSTypes.h

OSStatus

A numeric code used in Carbon to indicate the return status of a function.

typedef SInt32 OSStatus;
Discussion

The system software sometimes uses error codes to inform an application that a requested service is not possible. Many functions return a result code of type OSStatus that indicates whether the function completed successfully, and if not, what the reason for failure was.

If you want to use OSStatus to define error codes for your application, Apple recommends that you use values in the range 1000 through 9999 inclusive. Values outside of this range are reserved by Apple for internal use.

Availability
  • Available in OS X v10.0 and later.
Declared In
MacTypes.h