Skip to main content

XErrorSetOptions

Specifies the desired behavior when an error occurs in the gaming OS or gaming runtime.

Syntax

Parameters

optionsDebuggerPresent   _In_
Type: XErrorOptions
Specifies the desired behavior when the debugger is attached. optionsDebuggerNotPresent   _In_
Type: XErrorOptions
Specifies the desired behavior when the debugger is not attached.

Return value

Type: void

Remarks

This function isn’t safe to call on a time-sensitive thread. For more information, see Time-sensitive threads.
Use this function to specify how the game should react when an error occurs in the gaming OS or gaming runtime. By default, the game does nothing if a debugger isn’t attached and outputs debug messages to the debugger if it’s attached. If a debugger is attached and optionsDebuggerPresent is set to [XErrorOptions::DebugBreakOnError], the system breaks into the debugger and outputs debug messages. You can temporarily disable this behavior through the watch window by setting the value of the global variable, XErrorDisableDebugBreak, to true. The following example illustrates how to set error options, define a custom error callback, and set the custom callback to receive error notifications by the system.

Requirements

Header: XError.h Library: xgameruntime.lib Supported platforms: Windows, XBOX One family consoles and XBOX Series consoles

Conceptual documentation

See also

XError members
XErrorOptions
Last modified on August 20, 2026