pub fn check_error(
    result: &RawAVMOutcome,
    error: impl ToErrorCode + ToString
) -> bool