Skip to content

Commit b4a8a53

Browse files
committed
Rust: print error message on trap write failure
1 parent 8c55e4f commit b4a8a53

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

rust/extractor/src/main.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,13 @@ impl<'a> Extractor<'a> {
456456
DefMap::ROOT,
457457
&mut trap,
458458
);
459-
trap.commit();
460-
459+
trap.commit().unwrap_or_else(|err| {
460+
log::error!(
461+
"Failed to write trap file for crate: {}: {}",
462+
root_module_file,
463+
err.to_string()
464+
)
465+
});
461466
fn go(
462467
db: &dyn HirDatabase,
463468
map: &DefMap,

0 commit comments

Comments
 (0)