equal
deleted
inserted
replaced
40 |
40 |
41 pub fn map_lock_error<T>(e: std::sync::PoisonError<T>) -> PyErr { |
41 pub fn map_lock_error<T>(e: std::sync::PoisonError<T>) -> PyErr { |
42 PyRuntimeError::new_err(format!("In Rust PyO3 bindings: {e}")) |
42 PyRuntimeError::new_err(format!("In Rust PyO3 bindings: {e}")) |
43 } |
43 } |
44 |
44 |
45 /// Submodule to hold Mercurial errors defined on the Python side |
45 pub fn map_try_lock_error<T>(e: std::sync::TryLockError<T>) -> PyErr { |
46 /// |
46 PyRuntimeError::new_err(format!("In Rust PyO3 bindings: {e}")) |
47 /// This is better for clarity, as many hg-core errors have the same names |
47 } |
48 /// as their Python world counterparts |
48 |
49 pub mod mercurial_py_errors { |
49 pub mod mercurial_py_errors { |
50 pyo3::import_exception!(mercurial.error, RevlogError); |
50 pyo3::import_exception!(mercurial.error, RevlogError); |
51 } |
51 } |
52 |
52 |
53 pub fn revlog_error_from_msg(e: impl ToString) -> PyErr { |
53 pub fn revlog_error_from_msg(e: impl ToString) -> PyErr { |