|
Entropic 2.3.8
Local-first agentic inference engine
|
Error types for cross-.so error reporting. More...


Go to the source code of this file.
Typedefs | |
| typedef struct entropic_engine * | entropic_handle_t |
| Opaque handle to an entropic engine instance. | |
| typedef void(* | entropic_error_callback_t) (entropic_error_t code, const char *message, void *user_data) |
| Error callback type for async error reporting. | |
Functions | |
| ENTROPIC_EXPORT const char * | entropic_last_error (entropic_handle_t handle) |
| Get the last error message for a handle. | |
| ENTROPIC_EXPORT const char * | entropic_error_name (entropic_error_t code) |
| Get the human-readable name for an error code. | |
| ENTROPIC_EXPORT entropic_error_t | entropic_set_error_callback (entropic_handle_t handle, entropic_error_callback_t callback, void *user_data) |
| Register an error callback on a handle. | |
Error types for cross-.so error reporting.
Exceptions do NOT cross .so boundaries. All cross-boundary error reporting uses:
Definition in file error.h.
| typedef void(* entropic_error_callback_t) (entropic_error_t code, const char *message, void *user_data) |
Error callback type for async error reporting.
Registered via entropic_set_error_callback(). Called from the thread where the error occurs. The callback MUST NOT call back into the entropic API (deadlock risk). Keep callbacks short — log and return.
| code | Error code. |
| message | Null-terminated error message. Valid only for callback duration. |
| user_data | Opaque pointer passed during registration. @callback |
| typedef struct entropic_engine* entropic_handle_t |
Opaque handle to an entropic engine instance.
All per-handle functions (including entropic_last_error) operate on this. Created by entropic_create(), destroyed by entropic_destroy().
| enum entropic_error_t |
Error codes returned by all C API functions.
ENTROPIC_OK (0) on success. All other values indicate failure. Use entropic_error_name() to get a human-readable string for logging.
| ENTROPIC_EXPORT const char * entropic_error_name | ( | entropic_error_t | code | ) |
Get the human-readable name for an error code.
| code | Error code. |
| code | Error code to look up. |
| ENTROPIC_EXPORT const char * entropic_last_error | ( | entropic_handle_t | handle | ) |
Get the last error message for a handle.
Returns the error message from the most recent failed operation on this handle. The returned string is owned by the handle and valid until the next API call on the same handle.
| handle | Engine handle (may be NULL for global errors during create). |
Get the last error message for a handle.
Pre-v2.2.6 the public symbol lived in src/types/error.cpp and ignored its handle parameter (v1.8.0 TODO never done). Moved here because the private engine_handle struct is only visible in the facade. Returns a thread-local cache copy so the pointer stays valid until the same thread reads again — matches the v1.8.0 contract documented in include/entropic/types/error.h.
@utility
Definition at line 90 of file entropic.cpp.
| ENTROPIC_EXPORT entropic_error_t entropic_set_error_callback | ( | entropic_handle_t | handle, |
| entropic_error_callback_t | callback, | ||
| void * | user_data | ||
| ) |
Register an error callback on a handle.
Only one callback per handle. Setting a new one replaces the previous. Pass NULL to remove.
| handle | Engine handle. |
| callback | Callback function, or NULL to remove. |
| user_data | Opaque pointer forwarded to callback. |
| handle | Engine handle. |
| callback | Callback function, or NULL to remove. |
| user_data | Opaque pointer forwarded to callback. |