added setup strict mode

This commit is contained in:
2026-04-03 00:29:44 -04:00
parent 5c1779651c
commit 776a442374
5 changed files with 53 additions and 32 deletions

View File

@ -38,7 +38,7 @@ pub struct Database {
}
impl Database {
pub fn new(val: &serde_json::Value) -> Result<Self, crate::drop::Drop> {
pub fn new(val: &serde_json::Value) -> (Self, crate::drop::Drop) {
let mut db = Self {
enums: HashMap::new(),
types: HashMap::new(),
@ -151,10 +151,12 @@ impl Database {
}
db.compile(&mut errors);
if !errors.is_empty() {
return Err(crate::drop::Drop::with_errors(errors));
}
Ok(db)
let drop = if errors.is_empty() {
crate::drop::Drop::success()
} else {
crate::drop::Drop::with_errors(errors)
};
(db, drop)
}
/// Override the default executor for unit testing