This way, the behaviour of `gix::Error` is the same as it was before without actually exposing an `Exn` error tree.
Unified · Split
| @@ -280,8 +280,10 @@ jobs: · 279 unmodified lines | ||
| 280 | 280 | # due to being more in line with some Unix-oriented assumptions. So we need to verify that |
| 281 | 281 | # the test suite is compatible with being run even outside that environment, including that |
| 282 | 282 | # `gix-testtools` is still able to run fixture scripts with the `bash` shell as intended. |
| 283 | + # `gix-error` is excluded because it gets compiled with the wrong feature toggles here. | |
| 284 | + # It's tested individually. | |
| 283 | 285 | run: | # zizmor: ignore[template-injection] |
| 284 | − cargo nextest run --workspace --no-fail-fast -- ${{ matrix.test-args }} | |
| 286 | + cargo nextest run --workspace --no-fail-fast --exclude gix-error -- ${{ matrix.test-args }} | |
| 285 | 287 | - name: Check that tracked archives are up to date |
| 286 | 288 | run: | |
| 287 | 289 | # If this fails, the fix is usually to commit a regenerated archive. |
| @@ -24,7 +24,7 @@ required-features = ["blocking-network-client"] · 23 unmodified lines | ||
| 24 | 24 | |
| 25 | 25 | [features] |
| 26 | 26 | |
| 27 | −default = ["max-performance-safe", "comfort", "basic", "extras"] | |
| 27 | +default = ["max-performance-safe", "comfort", "basic", "extras", "auto-chain-error"] | |
| 28 | 28 | |
| 29 | 29 | #! There are various categories of features which help to optimize performance and build times. `gix` comes with 'batteries included' and everything is |
| 30 | 30 | #! enabled as long as it doesn't sacrifice compatibility. Most users will be fine with that but will pay with higher compile times than necessary as they |
| @@ -272,6 +272,12 @@ zlib-stock = ["gix-features/zlib"] · 241 unmodified lines | ||
| 272 | 272 | #! |
| 273 | 273 | #! The catch-all of feature toggles. |
| 274 | 274 | |
| 275 | +## All [`gix::Error`](crate::Error) will produce error chains, which makes them work as expected in conjunction with `anyhow`. | |
| 276 | +auto-chain-error = ["gix-error/auto-chain-error"] | |
| 277 | + | |
| 278 | +## The opposite of `auto-chain-error`. Use it to override `auto-chain-error`. | |
| 279 | +tree-error = ["gix-error/tree-error"] | |
| 280 | + | |
| 275 | 281 | ## Enable tracing using the `tracing` crate for coarse tracing. |
| 276 | 282 | tracing = ["gix-features/tracing"] |
| 277 | 283 | |
| @@ -407,7 +413,7 @@ document-features = { version = "0.2.0", optional = true } · 129 unmodified lines | ||
| 407 | 413 | [dev-dependencies] |
| 408 | 414 | # For additional features that aren't enabled by default due to MSRV |
| 409 | 415 | gix = { path = ".", default-features = false, features = [ |
| 410 | − "need-more-recent-msrv", | |
| 416 | + "need-more-recent-msrv", "tree-error" | |
| 411 | 417 | ] } |
| 412 | 418 | pretty_assertions = "1.4.0" |
| 413 | 419 | gix-testtools = { path = "../tests/tools" } |
| @@ -158,6 +158,7 @@ unit-tests: · 157 unmodified lines | ||
| 158 | 158 | cargo nextest run -p gix-worktree-state-tests --features gix-features-parallel --no-fail-fast |
| 159 | 159 | cargo nextest run -p gix-worktree-tests --features gix-features-parallel --no-fail-fast |
| 160 | 160 | cargo nextest run -p gix-error --no-fail-fast --test auto-chain-error --features auto-chain-error |
| 161 | + cargo nextest run -p gix-error --no-fail-fast | |
| 161 | 162 | cargo nextest run -p gix-hash --no-fail-fast |
| 162 | 163 | cargo nextest run -p gix-hash --features sha256 --no-fail-fast |
| 163 | 164 | cargo nextest run -p gix-hash --no-default-features --features sha256 --no-fail-fast # TODO: make this actually work by removing 'sha1' from default features. |