error_context

Macro error_context 

Source
macro_rules! error_context {
    ($message:expr) => { ... };
    ($message:expr, $function:expr) => { ... };
}
Expand description

Macro to create a new error context with location information

ยงExample

use scirs2_core::error_context;
use scirs2_core::error::{CoreResult, CoreError};

fn example() -> CoreResult<()> {
    let condition = false;
    if condition {
        return Err(CoreError::ComputationError(error_context!("An error occurred")));
    }
    Ok(())
}