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

# XErrorOptions

> XErrorOptions

# XErrorOptions

描述在遊戲 OS 或遊戲執行階段發生錯誤時，遊戲應如何運作。

## 語法

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

## 常數

| 常數 | 描述 |
| - | - |
| None | 發生錯誤時，不執行任何動作。<br />這是沒有偵錯工具時的預設選項。 |
| OutputDebugStringOnError | 發生錯誤時，輸出偵錯訊息。<br />這是有偵錯工具時的預設選項。 |
| DebugBreakOnError | 發生錯誤時，中斷進入偵錯工具並輸出偵錯訊息。 |
| FailFastOnError | 發生錯誤時，要求[快速失敗](https://learn.microsoft.com/cpp/intrinsics/fastfail?view=vs-2019)以立即終止呼叫處理序。 |

## 備註

[XErrorSetOptions](/zh-TW/reference/system/xerror/functions/xerrorsetoptions) 函式會使用 **XErrorOptions** 來描述發生錯誤時遊戲應如何運作，視是否有偵錯工具而定。如果指定了 `OutputDebugStringOnError` 或 `DebugBreakOnError` 且有偵錯工具，則會將包含 HRESULT 錯誤碼、目前執行緒 ID 和錯誤訊息的偵錯字串傳送至偵錯工具以供顯示。如果指定了 `DebugBreakOnError`，遊戲會中斷進入偵錯工具。

## 需求

**標頭：** XError.h

**支援的平台：** Windows、XBOX One 系列主機和 XBOX Series 主機

## 另請參閱

[XError 成員](/zh-TW/reference/system/xerror/xerror_members)\
[XErrorSetOptions](/zh-TW/reference/system/xerror/functions/xerrorsetoptions)


## Related topics

- [XErrorOptions](/reference/system/xerror/enums/xerroroptions.md)
- [XErrorSetOptions](/reference/system/xerror/functions/xerrorsetoptions.md)
