diff rust/hg-pyo3/src/exceptions.rs @ 52408:20c0472b2ab7

rust-pyo3: defining GraphError This pretty much parallels the way in works with `cpython`. A warning, though: this new `pyo3_rustext.GraphError` is not the same as `rustext.GraphError`, yet both subclass `ValueError`.
author Georges Racinet <georges.racinet@cloudcrane.io>
date Sat, 30 Nov 2024 20:27:11 +0100
parents
children 6e8ba52857df
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rust/hg-pyo3/src/exceptions.rs	Sat Nov 30 20:27:11 2024 +0100
@@ -0,0 +1,4 @@
+use pyo3::create_exception;
+use pyo3::exceptions::PyValueError;
+
+create_exception!(pyo3_rustext, GraphError, PyValueError);