Skip to main content

lumen_last_error

Function lumen_last_error 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn lumen_last_error() -> *const c_char
Expand description

Last error message set by any lumen_* call on this thread. Returns null if no error has been recorded on this thread AND no error has been recorded globally. The pointer is valid until the next lumen_* call on this thread that produces an error.

W6.12 added a global fallback: when the thread-local slot is empty (the common multi-thread embedder mistake of writing on thread A and reading on thread B), we return the most recent error from any thread instead of null.