GithubHelp home page GithubHelp logo

Comments (6)

brson avatar brson commented on July 25, 2024

Yes, this library allocates in the chain_err method. Putting the "chained errors" into boxes on the heap is one of the primary tradeoffs it makes.

from error-chain.

lilith avatar lilith commented on July 25, 2024

Would there be any way to create or mark an error to prevent allocations? I.e, if I'm manually handling OOM conditions, but want to represent the result as an Error, can I do so without allocs?

Clarification: I wouldn't expect any behavior other than a generic error with no metadata; I would also expect chain_error to discard anything provided.

from error-chain.

Yamakaky avatar Yamakaky commented on July 25, 2024

Closing for #64

from error-chain.

lilith avatar lilith commented on July 25, 2024

My use case is runtime-based, i.e, I'd like chain_error functionality except for one class of origin error. I think the compile-time feature is awesome, though.

I should probably private-fork error_chain given the particular requirements of my lib and try to figure out a way to make this work. Thanks for the feedback!

from error-chain.

Yamakaky avatar Yamakaky commented on July 25, 2024

It could help others. Do you have any idea how we should change the syntax?

from error-chain.

lilith avatar lilith commented on July 25, 2024

I haven't done any exploratory work, no. I'm a few days off from refactoring error handling in my lib.

from error-chain.

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.