Skip to content

Conversation

@Frando
Copy link
Member

@Frando Frando commented Nov 4, 2025

Description

Adds impl StackError for anyhow::Error under the anyhow feature flag.

Breaking Changes

Notes & open questions

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.

@github-actions
Copy link

github-actions bot commented Nov 4, 2025

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/n0-error/pr/14/docs/n0_error/

Last updated: 2025-11-11T21:54:04Z

Copy link
Member

@matheus23 matheus23 left a comment

Choose a reason for hiding this comment

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

Needs the module docs under "Feature flags" to be updated to mention the additional implementations you now get with the anyhow feature.


Tbh, the anyhow feature has confused me with n0-error so far.
In all our stuff I've basically replaced anyhow! with bail_any! and generally replaced anyhow::Error and anyhow::Result with n0_error::Error and n0_error::Result.

I guess this might be useful for third parties that don't have the luxury of completely getting rid of anyhow.

@Frando
Copy link
Member Author

Frando commented Nov 4, 2025

Yeah, the thing is that anyhow::Error does not implement std::error::Error so without the compat feature the result extensions won't work on anyhow errors, and to go from anyhow to AnyError the way is AnyError::from_std(err.into_boxed_dyn_error()), which is cumbersome.

@Frando Frando changed the title feat: impl StackResultExt for anyhow:::Error feat: impl StackError for anyhow:::Error Nov 11, 2025
@Frando Frando merged commit b11a365 into main Nov 11, 2025
15 checks passed
@matheus23 matheus23 deleted the Frando/anyhow-ext branch November 12, 2025 08:24
Frando added a commit that referenced this pull request Nov 12, 2025
## Description

* Remove `anyhow` from the default features. This was added
inadvertently in #14
* Clippy fixes for `n0-error-macros`
* Do not run doc examples in n0-error-macros as doctests, they don't
compile without n0-error

## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [ ] Self-review.
- [ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [ ] Tests if relevant.
- [ ] All breaking changes documented.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants