Documentation Index
Fetch the complete documentation index at: https://docs.hyperx.dev/llms.txt
Use this file to discover all available pages before exploring further.
Overview
- When a HyperX Core API request fails, the SDK throws
HyperXServerException. - This lets the game client detect server failures and show a proper message to the player.
- Core returns a structured error response together with
x-service,x-trace-id, andx-request-idheaders.
Exception fields
HyperXServerException includes the following fields:
-
ErrorCode: The server error code. -
Service: The internal service identifier where the error happened. -
ServerMessage: A human-readable error message from the server. -
StatusCode: The HTTP status code. -
TraceId: A trace identifier you can correlate with server logs. -
RequestId: A request-scoped identifier. -
Context: Additional context values useful for debugging. -
ResponseBody: The raw response body returned by the server. -
The server
codefield is a stable machine-readable code that the SDK can branch on. -
When the server includes
service,traceId,requestId, orcontextin the response body, the SDK parses them into structured fields. -
If the body does not include tracing metadata, the SDK falls back to
x-service,x-trace-id, andx-request-idresponse headers.
Basic example
Missing storage file handling
When a Public Storage file does not exist, Core returnsSTORAGE_OBJECT_NOT_FOUND. In game clients, avoid showing the raw backend message to players. Handle it by using a default resource, retrying after content is published, or guiding the operator to upload the missing file.
ErrorCodeServiceTraceIdRequestIdprojectCode,key,filename, andoperationfromContext
Handling patterns
- APIs that are awaited directly, such as
GetMeta,GetHash, andCore.GetTime, can be handled with a normaltry/catch. PublicStorage.Get(...)returnsFileDownloadProgressimmediately, so download failures should be handled atawait progress.File.