started using scope properly, improved error backtrace conversion

This commit is contained in:
Anton-4 2021-10-16 19:37:20 +02:00
parent 2158686a0a
commit a272765fc7
19 changed files with 184 additions and 110 deletions

View file

@ -1,5 +1,7 @@
use snafu::{Backtrace, Snafu};
use crate::symbol::IdentId;
#[derive(Debug, Snafu)]
#[snafu(visibility(pub))]
pub enum ModuleError {
@ -13,6 +15,16 @@ pub enum ModuleError {
all_ident_ids: String,
backtrace: Backtrace,
},
#[snafu(display(
"IdentIdNotFound: I could not find IdentId {:?} in ident_ids {:?}.",
ident_id,
ident_ids_str
))]
IdentIdNotFound {
ident_id: IdentId,
ident_ids_str: String,
backtrace: Backtrace,
},
}
pub type ModuleResult<T, E = ModuleError> = std::result::Result<T, E>;