Function wilton_rusty::create_wilton_error [−][src]
pub fn create_wilton_error(error_opt: Option<String>) -> *mut c_char
Create an error message, that can be passed back to Wilton
Helper function, that can be used with Rust Result
s, returned
from wilton_rust::register_wiltoncall
function.
Arguments
error_opt
- optional error message, that should be passed back to Wilton
Example
// register a call let res = wilton_rust::register_wiltocall("hello", |obj: MyObj1| { hello(obj) }); // check for error if res.is_err() { // return error message to Wilton // return wilton_rust::create_wilton_error(res.err()); () } // return success status to Wilton wilton_rust::create_wilton_error(None) ()