rust/hg-pyo3/src/exceptions.rs
changeset 52795 adf91dfe6c04
parent 52792 acae91fad6be
child 52850 ffda57aa98fa
--- a/rust/hg-pyo3/src/exceptions.rs	Wed Dec 25 19:05:27 2024 +0100
+++ b/rust/hg-pyo3/src/exceptions.rs	Wed Dec 25 19:06:59 2024 +0100
@@ -78,3 +78,9 @@
         }
     }
 }
+
+pub fn graph_error(_err: hg::GraphError) -> PyErr {
+    // ParentOutOfRange is currently the only alternative
+    // in `hg::GraphError`. The C index always raises this simple ValueError.
+    PyValueError::new_err("parent out of range")
+}