Skip to content

Commit

Permalink
More error context for scan_rust_file
Browse files Browse the repository at this point in the history
  • Loading branch information
declantsien committed Apr 10, 2024
1 parent 049db26 commit f5859c0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/lisp-doc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ edition = "2021"
[dependencies]
lisp-util.path = "../lisp-util"
darling = "0.20"
anyhow = "1.0"
lazy_static.workspace = true
libc.workspace = true
regex.workspace = true
Expand Down
6 changes: 5 additions & 1 deletion crates/lisp-doc/docfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ pub unsafe extern "C" fn scan_rust_file(
) {
let add_global = add_global_fp.expect("Function pointer to 'add_global' method was null");
let filename = CStr::from_ptr(filename).to_str().unwrap();
let fp = BufReader::new(File::open(&*filename).unwrap());
let fp = BufReader::new(
File::open(&*filename)
.map_err(|e| anyhow::format_err!("{:?}: {:?}", &*filename, e))
.unwrap(),
);

let mut in_docstring = false;
let mut docstring = String::new();
Expand Down

0 comments on commit f5859c0

Please sign in to comment.