Coder Social home page Coder Social logo

Comments (4)

progval avatar progval commented on June 30, 2024

What improvements do you want to do?

from rust-multiaddr.

dignifiedquire avatar dignifiedquire commented on June 30, 2024

Not sure, I am still very new to rust and unsure of tgr best way for a library to handle and expose errors.

from rust-multiaddr.

progval avatar progval commented on June 30, 2024

I asked earlier at #rust-fr how people do it; someone answered that most of the time we create an enum to use as the Err part of a Result. They also told me libraries exist to avoid this boilerplate, but I don't think we need it for now (not many error sources).

I think here we could just use Result<blah, String>, and return Err(format!{"{:?"}, error_from_nom */ }) most of the time, and an enum otherwise. eg. for decapsulate: enum DecapsulateError { ParseError(String), ProtocolNotFound }.

from rust-multiaddr.

mxinden avatar mxinden commented on June 30, 2024

I am closing here as (a) the discussion has stalled and (b) I would say error handling is in a good state. Please comment in case you think otherwise.

from rust-multiaddr.

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.