Skip to main content

ss_runtime_get_last_error

Function ss_runtime_get_last_error 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn ss_runtime_get_last_error( context: *mut c_void, ) -> i32
Expand description

Why the last call that tracks a reason failed, as a stable code: 1 EmptyData, 2 InvalidVersion, 3 AnimationNotFound, 4 NotLoaded, 5 InvalidParameter, 6 MemoryError, 7 MalformedEffect, 99 Unknown. 0 means the last such call succeeded, and so does a null context.

Every fallible entry point that has a context to write to clears this on entry, so it always describes the most recent one rather than some earlier failure. The exceptions are the constructors that take no context (ss_resource_create_borrow / ss_resource_create_copy and ss_effect_slot_create), which have nowhere to record: a null return from those is all there is.

Reading does not clear it. Read it immediately after the call that returned false, before making another on the same context.