/// Report an error, both to the console and to error logs
Report an error, both to the console and to error logs
Report an error both to the console and to error logs
pub fn report_error(volta_version: &str, err: &VoltaError) {
    let message = err.to_string();
    error!("{}", message);
    if let Some(details) = compose_error_details(err) {
        debug!("{}", details);
        // Note: Writing the error log info directly to stderr as it is a message for the user
        // Any custom logs will have all of the details already, so showing a message about writing
        // the error log would be redundant
        match write_error_log(volta_version, message, details) {
            Ok(log_file) => {
                eprintln!("Error details written to {}", log_file.to_string_lossy());
            }
            Err(_) => {
                eprintln!("Unable to write error log!");
            }
        }
    }
}
pub fn report_error ( volta_version : & str , err : & VoltaError ) { let message = err . to_string ( ) ; error ! ( " " message ) ; if let Some ( details ) = compose_error_details ( err ) { debug ! ( " " details ) ; // Note: Writing the error log info directly to stderr as it is a message for the user // Any custom logs will have all of the details already, so showing a message about writing // the error log would be redundant match write_error_log ( volta_version , message , details ) { Ok ( log_file ) => { eprintln ! ( " " log_file to_string_lossy ( ) ) ; } Err ( _ ) => { eprintln ! ( " " ) ; } } } }
Report an error, both to the console and to error logs
Report an error both to the console and to error logs
volta_version
&str
err
&VoltaError