From a3b1178fd3bf700acb473f1d4a8158c26c86edda Mon Sep 17 00:00:00 2001 From: pjht Date: Mon, 24 Oct 2022 08:45:38 -0500 Subject: [PATCH] Clean up handling of nonexistent symbol tables --- src/main.rs | 2 +- src/symbol_table.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index d16ea6a..6bdd31e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -69,7 +69,7 @@ fn main() -> Result<(), anyhow::Error> { let mut symbol_tables = SymbolTables::new(); if let Some(initial_tables) = config.symbol_tables { for path in initial_tables { - symbol_tables.load_table(path, true).unwrap(); + symbol_tables.load_table(path, true)?; } } Repl::<_, anyhow::Error>::new(EmuState { diff --git a/src/symbol_table.rs b/src/symbol_table.rs index 2c381a9..019f313 100644 --- a/src/symbol_table.rs +++ b/src/symbol_table.rs @@ -27,7 +27,7 @@ impl SymbolTable { let mut file = elf::File::open_stream(&mut cached_reader)?; let (symtab, symstrtab) = file .symbol_table()? - .ok_or_else(|| anyhow!("No symbol table in file"))?; + .ok_or_else(|| anyhow!("No symbol table in {}", path))?; let symbols = symtab .iter() .skip(1)