pub fn invariant(cond: bool, msg: String) -> Result<(), Error>