> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XErrorOptions

> XErrorOptions

# XErrorOptions

描述当游戏 OS 或游戏运行时出现错误时游戏应如何行为。

## Syntax

```cpp theme={null}
enum class XErrorOptions  : uint32_t  
{  
    None = 0x00,  
    OutputDebugStringOnError = 0x01,  
    DebugBreakOnError = 0x02,  
    FailFastOnError = 0x04,  
}  
```

## Constants

| 常量 | 说明 |
| - | - |
| None | 出错时，不执行任何操作。 如果不存在调试器，则为默认选项。 |
| OutputDebugStringOnError | 出错时，输出调试消息。 如果存在调试器，则为默认选项。 |
| DebugBreakOnError | 出错时，中断到调试器并输出调试消息。 |
| FailFastOnError | 出错时，请求[快速失败](https://learn.microsoft.com/cpp/intrinsics/fastfail?view=vs-2019)以立即终止调用进程。 |

## Remarks

**XErrorOptions** 由 [XErrorSetOptions](https://docs.xbox.com/zh-CN/reference/system/xerror/functions/xerrorsetoptions.md) 函数使用，用于描述出错时游戏应如何行为，具体取决于是否存在调试器。如果指定了 `OutputDebugStringOnError` 或 `DebugBreakOnError` 并且存在调试器，则包含 HRESULT 错误代码、当前线程 ID 和错误消息的调试字符串将发送到调试器进行显示。如果指定了 `DebugBreakOnError`，游戏会中断到调试器。

## Requirements

**头文件：** XError.h

**受支持的平台：** Windows、XBOX One 系列主机和 XBOX Series 主机

## See also

[XError members](https://docs.xbox.com/zh-CN/reference/system/xerror/xerror_members.md)\
[XErrorSetOptions](https://docs.xbox.com/zh-CN/reference/system/xerror/functions/xerrorsetoptions.md)


## Related topics

- [XErrorSetOptions](https://docs.xbox.com/zh-CN/reference/system/xerror/functions/xerrorsetoptions.md)
- [XError 成员（API 内容）](https://docs.xbox.com/zh-CN/reference/system/xerror/xerror_members.md)
- [DSTORAGE_REQUEST_OPTIONS](https://docs.xbox.com/zh-CN/reference/system/dstorage/structs/dstorage_request_options.md)
- [XMemSetOption](https://docs.xbox.com/zh-CN/reference/system/xmem/functions/xmemsetoption.md)
- [PartyManager::GetOption](https://docs.xbox.com/zh-CN/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_getoption.md)
