The open source OpenXR runtime

xrt: add new xrt_result_t error codes

* adds generic and future specific error codes

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2554>

authored by

Korcan Hussein and committed by
Marge Bot
05fc05ca 57a9631a

+24
+4
src/xrt/auxiliary/util/u_pretty_print.c
··· 228 228 case XRT_ERROR_SYNC_PRIMITIVE_CREATION_FAILED: DG("XRT_ERROR_SYNC_PRIMITIVE_CREATION_FAILED"); return; 229 229 case XRT_ERROR_IPC_SERVICE_ALREADY_RUNNING: DG("XRT_ERROR_IPC_SERVICE_ALREADY_RUNNING"); return; 230 230 case XRT_ERROR_IPC_MAINLOOP_FAILED_TO_INIT: DG("XRT_ERROR_IPC_MAINLOOP_FAILED_TO_INIT"); return; 231 + case XRT_ERROR_INVALID_ARGUMENT: DG("XRT_ERROR_INVALID_ARGUMENT"); return; 232 + case XRT_OPERATION_CANCELLED: DG("XRT_OPERATION_CANCELLED"); return; 233 + case XRT_ERROR_FUTURE_RESULT_NOT_READY: DG("XRT_ERROR_FUTURE_RESULT_NOT_READY"); return; 234 + case XRT_ERROR_FUTURE_ALREADY_COMPLETE: DG("XRT_ERROR_FUTURE_ALREADY_COMPLETE"); return; 231 235 } 232 236 // clang-format on 233 237
+20
src/xrt/include/xrt/xrt_results.h
··· 39 39 XRT_SPACE_BOUNDS_UNAVAILABLE = 3, 40 40 41 41 /*! 42 + * An (asynchronous) operation has been cancelled. 43 + */ 44 + XRT_OPERATION_CANCELLED = 4, 45 + 46 + /*! 42 47 * A problem occurred either with the IPC transport itself, with invalid commands from the client, or with 43 48 * invalid responses from the server. 44 49 */ ··· 231 236 * The IPC server couldn't starts it mainloop. 232 237 */ 233 238 XRT_ERROR_IPC_MAINLOOP_FAILED_TO_INIT = -38, 239 + 240 + /*! 241 + * Invalid function arguments passed in, e.g. null or out-of-range values. 242 + */ 243 + XRT_ERROR_INVALID_ARGUMENT = -39, 244 + 245 + /*! 246 + * Querying result of a future before it is ready. 247 + */ 248 + XRT_ERROR_FUTURE_RESULT_NOT_READY = -40, 249 + 250 + /*! 251 + * Invoking complete on an already completed future 252 + */ 253 + XRT_ERROR_FUTURE_ALREADY_COMPLETE = -41, 234 254 } xrt_result_t;