[−][src]Function arrayfire::register_error_handler
pub fn register_error_handler(cb_value: Callback)
Register user provided error handler
Examples
#[macro_use] extern crate arrayfire; use arrayfire::{AfError, Callback, info, register_error_handler}; use std::error::Error; fn handleError(error_code: AfError) { match error_code { AfError::SUCCESS => {}, /* No-op */ _ => panic!("Error message: {}", error_code.description()), } } fn main() { //Registering the error handler should be the first call //before any other functions are called if your version //of error is to be used for subsequent function calls register_error_handler(Callback::new(handleError)); info(); }