<!--
{
  "documentType" : "article",
  "framework" : "ExceptionHandling",
  "identifier" : "/documentation/ExceptionHandling/system-hang-constants",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "System Hang Constants"
}
-->

# System Hang Constants

Use one or more of the following constants in the parameter of [`setExceptionHangingMask(_:)`](/documentation/ExceptionHandling/NSExceptionHandler/setExceptionHangingMask(_:))
to specify the types of exceptions that cause the exception to halt execution so
a debugger can be attached.

## Overview

When exception-handling domains are nested, [`NSHangOnTopLevelExceptionMask`](/documentation/ExceptionHandling/NSHangOnTopLevelExceptionMask)
deals with exceptions that would make it to the top two levels of exception handlers.
In the main thread of a Cocoa application, the top-level handler is the global <doc://com.apple.documentation/documentation/AppKit/NSApplication>
instance.

## Topics

### Constants

[`NSHangOnUncaughtExceptionMask`](/documentation/ExceptionHandling/NSHangOnUncaughtExceptionMask)

The exception handler suspends execution when it detects an uncaught exception (other
than a system exception or runtime error).

[`NSHangOnUncaughtSystemExceptionMask`](/documentation/ExceptionHandling/NSHangOnUncaughtSystemExceptionMask)

The exception handler suspends execution when it detects an uncaught system exception.

[`NSHangOnUncaughtRuntimeErrorMask`](/documentation/ExceptionHandling/NSHangOnUncaughtRuntimeErrorMask)

The exception handler suspends execution when it detects an uncaught runtime error.

[`NSHangOnTopLevelExceptionMask`](/documentation/ExceptionHandling/NSHangOnTopLevelExceptionMask)

The exception handler suspends execution when it detects an exception that would
be handled by the top-level handler.

[`NSHangOnOtherExceptionMask`](/documentation/ExceptionHandling/NSHangOnOtherExceptionMask)

The exception handler suspends execution when it detects an exception that would
be handled by an object other than the top-level handler.

### Containing Objective-C enumeration



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)