mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 01:07:15 +03:00
b9f3c9c692
Summary: Introduce taggederror-util, which provides a new trait `AnyhowEdenExt`, which provides a method `eden_metadata` for anyhow errors and results. This method works much like `AnyhowExt::common_metadata`, but additionally supports extracting default error metadata from known `Tagged` types which are listed explicitly in the method implementation. Extend `FilteredAnyhow` to support a configuration "metadata function", which allows swapping out `eden_metadata` for the standard `common_metadata`. Modify Rust dispatch and Python bindings to use `AnyhowEdenExt` for metadata extraction and printing. Modify `intentional_error` to rely on `AnyhowEdenExt` for tagging (removes `.tagged` call, no tags will be visible if `AnyhowEdenExt` is not used). Reviewed By: DurhamG Differential Revision: D22927203 fbshipit-source-id: 04b36fdfaa24af591118acb9e418d1ed7ae33f91
25 lines
636 B
TOML
25 lines
636 B
TOML
[package]
|
|
name = "cpython-ext"
|
|
version = "0.1.0"
|
|
edition = "2018"
|
|
|
|
[features]
|
|
default = ["python2"]
|
|
python2 = ["python27-sys", "cpython/python27-sys"]
|
|
python3 = ["python3-sys", "cpython/python3-sys"]
|
|
|
|
[dependencies]
|
|
anyhow = "1.0.20"
|
|
cpython = { version = "0.5", default-features = false }
|
|
encoding = { path = "../encoding" }
|
|
lazy_static = "1"
|
|
libc = "0.2"
|
|
parking_lot = "0.9"
|
|
python27-sys = { version = "0.5", optional = true }
|
|
python3-sys = { version = "0.5", optional = true }
|
|
serde = "1"
|
|
taggederror = { path = "../taggederror" }
|
|
taggederror-util = { path = "../taggederror-util" }
|
|
thiserror = "1.0.5"
|
|
types = { path = "../types" }
|