highlight: Fix panic when cancelled before parsing a nested document

This commit is contained in:
Max Brunsfeld 2019-07-16 11:40:19 -07:00
parent 34de25ce54
commit bd466febb4
9 changed files with 201 additions and 74 deletions

View file

@ -28,7 +28,7 @@ pub fn parse_file_at_path(
) -> Result<bool> {
let mut _log_session = None;
let mut parser = Parser::new();
parser.set_language(language)?;
parser.set_language(language).map_err(|e| e.to_string())?;
let mut source_code = fs::read(path).map_err(Error::wrap(|| {
format!("Error reading source file {:?}", path)
}))?;