Giter VIP home page Giter VIP logo

Comments (3)

dtolnay avatar dtolnay commented on June 15, 2024 3

That sounds great to me. I filed one suggestion but I am excited to see this go forward.

from anyhow.

roblabla avatar roblabla commented on June 15, 2024

I started working on a new crate, core-error - exposing our own version of the Error trait. The goal of this crate is twofolds:

  • Provide a common trait for various error handling crates (Failure, Snafu, Fehler, Anyhow, error_chain, and any other)
  • Allow no_std libraries that don't want to depend on a specific error handling crate to still expose errors that can interoperate with those libraries.

Such a crate would work like this:

  • With the std feature, it just re-export std::error::*
  • With no-default-features, it exposes an Error trait similar to the one in std but without backtraces, and without the std/alloc-only impls.
  • Rustc version auto-detection is used to figure which errors to implement the trait on.
  • The alloc feature enables downcasting, in addition to supporting alloc errors
  • The crate would compile on all versions from 1.0.0 to the latest stable version.

The trait will be compatible with std's Error trait, and if libcore gains an Error trait in the future, it should be compatible with it too.

Once the crate reaches 1.0.0, I'll consider it ready for integration in the various error crates and will follow the same stability guarantee Rust does: No breaking changes ever.

Work has already started in https://github.com/core-error/core-error. I'd be interested in hearing feedback on the design!

from anyhow.

dtolnay avatar dtolnay commented on June 15, 2024

Closing as I don't think I need to track this here, we can follow up in issues of the core-error repo.

from anyhow.

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.