> ## 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.

# Types of error handling

> Common failure modes when calling XBOX services, including HTTP 400, 401, 403, and 503 responses, and how titles check HRESULT values to handle them.

Take special care when making a service call.
Your title should always handle errors when making network calls.

Even for service calls that have been working consistently during development, service calls can fail in real-world environments for a number of different reasons.
For example, your call may fail because:

* The network is not available.
* The service is too busy, returning a 503 HTTP status code.
* The request is not valid, returning a 400 HTTP status code.
* The user does not have the right permissions, returning a 403 HTTP status code.
* The user has been banned, returning a 401 HTTP status code.
* The HTTP stack is unable to send the request (ERROR\_TIMEOUT, RPC\_S\_CALL\_FAILED\_DNE, etc.)

The XSAPI C API reports these failures as `HRESULT` values instead of throwing exceptions.
Check the `HRESULT` that each function returns. For asynchronous calls, also check the completion result by calling `XAsyncGetStatus` or the operation's result function in your completion callback.
Pass a failed `HRESULT` to [XblGetErrorCondition](https://docs.xbox.com/reference/live/xsapi-c/errors_c/functions/xblgeterrorcondition.md) to classify the failure into a condition that your game can act on, such as `Network`, `Auth`, or `Http429TooManyRequests`.


## Related topics

- [Marketplace Error Handling](https://docs.xbox.com/services/playfab/economy-monetization/economy-v2/marketplace/marketplace-error-handling.md)
- [SDK error handling Best Practices](https://docs.xbox.com/services/playfab/live-service-management/service-gateway/automation/cloudscript/sdk-error-handling-best-practices.md)
- [Handling PlayFab Errors](https://docs.xbox.com/services/playfab/sdks/c/errors.md)
- [Handling common error cases](https://docs.xbox.com/services/playfab/multiplayer/matchmaking/error-cases.md)
- [Handling Lobby and Matchmaking C++ SDK errors](https://docs.xbox.com/services/playfab/multiplayer/lobby/lobby-and-matchmaking-client-sdk-errors.md)
