Errors and Diagnostics
Error Codes
A category narrows the cause; context and message explain the specific failed operation. Do not retry unchanged invalid geometry indefinitely. Initialization and simulation errors should stop dependent gameplay until recovery succeeds.
| API | Contract |
|---|---|
| JOLT_ERROR_NONE = 0 | No error; a valid query miss also belongs here. |
| JOLT_ERROR_INVALID_ARGUMENT = 1 | Invalid value, dimensions or input structure. |
| JOLT_ERROR_INITIALIZATION_FAILED = 2 | Runtime initialization failed. |
| JOLT_ERROR_INVALID_HANDLE = 3 | Invalid, stale or wrong-owner resource identity. |
| JOLT_ERROR_CREATION_FAILED = 4 | Native resource could not be created. |
| JOLT_ERROR_SIMULATION_FAILED = 5 | World stepping failed. |
| JOLT_ERROR_INTERNAL_EXCEPTION = 6 | An exception was translated at the native boundary. |
| JOLT_ERROR_INVALID_OPERATION = 7 | Operation is incompatible with current state or type. |
| JOLT_ERROR_QUERY_FAILED = 8 | Query execution failed. |
var err = jolt_get_error();
if (err.code == JOLT_ERROR_INVALID_ARGUMENT) {
show_debug_message("Check input: " + err.message);
} else if (err.code != JOLT_ERROR_NONE) {
show_debug_message(err.context + ": " + err.message);
}