Clarify parse command error message when failing to read source file
This commit is contained in:
parent
4db132ff94
commit
9185f6c168
1 changed files with 3 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use super::error::Result;
|
||||
use super::error::{Error, Result};
|
||||
use super::util;
|
||||
use std::fs;
|
||||
use std::io::{self, Write};
|
||||
|
|
@ -18,7 +18,8 @@ pub fn parse_file_at_path(
|
|||
let mut _log_session = None;
|
||||
let mut parser = Parser::new();
|
||||
parser.set_language(language)?;
|
||||
let source_code = fs::read(path)?;
|
||||
let source_code = fs::read(path)
|
||||
.map_err(|e| Error(format!("Error reading source file {:?}: {}", path, e)))?;
|
||||
|
||||
if debug_graph {
|
||||
_log_session = Some(util::log_graphs(&mut parser, "log.html")?);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue