Color theme

Error Handling

Eranio

Error Handling

Status codes

Code When
200 Normal answer, also for failed actions (see below)
204 CORS preflight
400 Required field missing (bans, mutes, chat, permissions)
403 Missing or wrong token
404 Unknown route or action
405 Wrong HTTP method

success and error

Actions answer with HTTP 200 and report the result in the body. Always check success:

{
  "success": false,
  "error": "Players are still in this world, send them elsewhere first"
}

Successful actions return "success": true plus details, for example:

{
  "success": true,
  "world": "farmwelt",
  "seed": "1791895563466",
  "warps_moved": 2
}

Typical errors

Error Cause
Player not online The player has to be online for this action
World not loaded Load or unpark the world first
This is the default world, set another default world first The default world cannot be unloaded or reset
Invalid name (a-z, 0-9, _ and -, 2 to 32 characters) Name rule for worlds
Unknown weather Weather ID does not exist in Hytale

Unexpected exceptions are logged in the server console with the handler name and returned as "error": "Internal error: ...".