feat(*): make all errors cloneable#128
Conversation
|
The main error I know of that's not cloneable is |
|
My main use-case for it so far has been that Hyper's As to how it's useful for |
|
Aha that'd do it! I wonder if maybe the concrete error types here could be cloneable (the ones for each specific situation) but then the "global" |
|
I agree that Also, a nit, but this repo isn't using the angular style commit messages :) |
|
The trend in the ecosystem is for errors to not implement A benefit to this in my mind is that, with errors that cannot be construct from outside the crate, that means that you only ever have an error when the crate detected one. If you can clone them, it's possible to think that more errors occurred than really did.
That sounds like a mistake :D |
|
Thanks for the input, y'all. Based on the ecosystem trends you pointed out, as well as the direction my compatibility PR for hyper is moving, I think it makes sense to just close this. |
When working on implementing compatibility with the
httpcrate over inhyper, I ran into a problem where the error types inhttpare notClone. This PR changes that.I guess this locks in the error API quite a bit (errors can't contain any non-cloneable information), but on the other hand it also makes it possible for
hyperto leverage logic fromhttpmore easily.Let me know if you like this or if I should try to make do with non-cloneable errors.