LemmyNet / activitypub-federation-rust

High-level Rust library for the Activitypub protocol
GNU Affero General Public License v3.0
409 stars 46 forks source link

Remove `anyhow` dependency #80

Closed cetra3 closed 9 months ago

cetra3 commented 10 months ago

I'm trying to use eyre with this crate and getting some really gnarly generic trait bound errors. It appears it's because functions like receive_activity and the like are coupled to ensuring that something can implement the anyhow::Error type.

I propose we should refactor this out, and rely solely on thiserror for errors within this crate and provide some way of bringing your own errors for library consumers.

Let me know if you're open to this and I can have a crack

Nutomic commented 10 months ago

This seems very tricky because anyhow is used for the library to wrap LemmyError which itself uses anyhow. I have nothing against such a change as long as it works with Lemmy, maybe by putting anyhow behind a feature flag?

cetra3 commented 10 months ago

You might be right, we might be able to coax the error into an anyhow::Error. I'll see how far I get & make sure lemmy compat isn't broken