Suggestion from @piotr-roslaniec (https://github.com/nucypher/nucypher-core/pull/54#discussion_r1212875461) : ```rust // Elsewhere fn map_py_value_err<T: fmt::Display>(err: T) -> PyErr { PyValueError::new_err(format!("{err}")) } ``` ```rust <potential error returning call>.map_err(map_py_value_err)?; ```