mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
2824ac99f7
Summary: The `map_pyerr<PE>` API is kind of hard to use correctly since the code that calls `map_pyerr` does not really know the best suitable error type. The existing code also "encourage"s the use of stdlib error types like RuntimeError, ValueError, etc since the code is shorter, which is not great. Error types from `mercurial.error` are better choices. With previous diffs in this stack, we now decide the Python error type based on the Rust error type. It's no longer necessary to specify an error type with `map_pyerr<PE>`. So let's just drop the type parameter. A `RustError` was added for error types that `cpython-ext` does not know how to convert. We should avoid leaking it to the Python land by just implementing how to convert `anyhow::Error` to `PyErr` in `cpython-ext`. Reviewed By: markbt Differential Revision: D19169527 fbshipit-source-id: f4563c36174cd51201b526bbc92a3f1c8a3da864 |
||
---|---|---|
.. | ||
modules | ||
src | ||
Cargo.toml |