Add Error Message Location (#112, #110, #108, #87); Some Minor Error Message Improvements #145

Merged
sb10q merged 5 commits from err_msg_improvement into master 2021-12-22 08:52:19 +08:00
1 changed files with 4 additions and 2 deletions
Showing only changes of commit 761e941cdc - Show all commits

View File

@ -197,7 +197,7 @@ impl Nac3 {
let (name, def_id, ty) = self
.composer
.register_top_level(stmt, Some(resolver.clone()), module_name.clone())
.unwrap();
.map_err(|e| exceptions::PyRuntimeError::new_err(format!("nac3 compilation failure: {}", e)))?;
name_to_def.insert(name, def_id);
if let Some(ty) = ty {
name_to_type.insert(name, ty);
@ -444,7 +444,9 @@ impl Nac3 {
);
let signature = store.add_cty(signature);
self.composer.start_analysis(true).unwrap();
self.composer.start_analysis(true).map_err(|e| exceptions::PyRuntimeError::new_err(format!(
"nac3 compilation failure: {}", e
)))?;
self.top_level = Some(Arc::new(self.composer.make_top_level_context()));
let top_level = self.top_level.as_ref().unwrap();
let instance = {