GithubHelp home page GithubHelp logo

Serde support about color-eyre HOT 2 OPEN

eyre-rs avatar eyre-rs commented on July 24, 2024
Serde support

from color-eyre.

Comments (2)

yaahc avatar yaahc commented on July 24, 2024

There is probably a law that states that any open source Rust project will eventually be asked for serde support.

Anyway, to have this would be great (maybe behind a feature flag, as is tradition).

The use case for me is that I have a networked library, and I want to propagate something like Report back to the client, to have more meaningful errors on the client.

I'd be happy to merge serde support but I'm worried that we would be fairly limited in what support we could implement and that it might not be what you have in mind. color-eyre only provides a hook for eyre, which itself stores errors as type erased trait objects. We can't accurately serialize the source error beyond converting it into a chain of messages that we reconstruct as a different type on the other side. We could serialize the content of the EyreHandler that color-eyre provides, and a limited version of the dyn Error which is recreated lossily on the other side and hidden inside of the Report, but that's pretty much the limit. Also it wouldn't be a serialization impl directly on the eyre::Report, it would instead have to be a fallible adapter that attempts to access the handler, and if the handler is the one exported by color-eyre it grabs that context, and the error and wraps them in a type that implements Serialize.

If you're still interested in this I can help describe how to implement it but otherwise I don't expect I'll be able to make time to implement this support myself in the near term.

from color-eyre.

yaahc avatar yaahc commented on July 24, 2024

Duplicate of #77 (kinda)

from color-eyre.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.