Skip to main content

return_error

Function return_error 

Source
pub unsafe fn return_error(
    error: &str,
    result_buf: *mut *mut u8,
    result_len: *mut usize,
) -> i32
Expand description

Return an error result to the framework

Wraps the error message in { "error": "..." } and returns error code 1.

§Safety

Same requirements as return_success.

§Example

unsafe {
    return return_error("Product not found", result_buf, result_len);
}