Skip to content

Conversation

@AdamGS
Copy link
Contributor

@AdamGS AdamGS commented Feb 10, 2026

Does this PR closes an open issue or discussion?

This is a long running low burning effort to improve errors.

What changes are included in this PR?

  1. Removes VortexError::Url variant - I don't think a single digit number of uses in peripheral crates merits a variant and a dependency here.
  2. When backtraces are disabled, we don't print them.
  3. Splits the Generic error variant into External and Other, where External is meant to wrap external errors, and Other is for any error that doesn't match an existing variant. Other is now also the default of vortex_err and vortex_bail. They are used widely and often have very different meaning, I think its better to convey vague intent than the wrong one.
  4. I've also split out the individual components of the error Display form to make it clearer what gets printed and how its constructed.

What is the rationale for this change?

Error display is a bit more compact when downstream users don't enable backtraces, and I believe this makes maintaining vortex-error a bit easier.

How is this change tested?

In addition to existing tests that verify the result type, I've added a few tests that

Are there any user-facing changes?

One less variant, and vortex_err and vortex_bail return a different type.

@AdamGS AdamGS requested a review from robert3005 February 10, 2026 19:16
@AdamGS AdamGS added the changelog/break A breaking API change label Feb 10, 2026
$crate::VortexError::Context($msg.into(), Box::new($err))
)
}};
(External: $err:expr) => {{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general - using macros is better than functions here as they don't frames

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 10, 2026

Merging this PR will improve performance by 12.36%

⚡ 1 improved benchmark
✅ 1134 untouched benchmarks
⏩ 1268 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation bitwise_not_vortex_buffer_mut[128] 530.3 ns 471.9 ns +12.36%

Comparing adamg/trim-backtraces (283ba01) with develop (8e92de5)

Open in CodSpeed

Footnotes

  1. 1268 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/break A breaking API change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant