Giter Club home page Giter Club logo

Comments (2)

warner avatar warner commented on May 27, 2024

Another option is to define some APIError event types for internal use, allow any machine's process() function to emit them, and have do_api() collect those just like it currently collects API Actions. But if it sees any error events, then do_api() returns an Err instead of an Ok. So do_api() -> Result<Actions, WormholeCoreError>, but none of the other machines' process() functions would return a Result. So the core would signal errors synchronously, which the API layer could then map into the approach of their choosing.

This would make it easier for e.g. Code::SetCode(code) to signal an error when the code is malformed. The main sticking point is to make sure that we haven't moved any other state machines in an irreversible way (although to be honest the Python code isn't very clear about how fatal errors are: if you make a mistake and submit a malformed code, then is the wormhole now permanently corrupted, or can you recover by trying again?).

from magic-wormhole.rs.

piegamesde avatar piegamesde commented on May 27, 2024

As of #94, all programmer related errors are eliminated at compile time by the type system. core sends any errors it has over the channel as APIEvent::GotError. The public API exposes this as a stream of Result<message type, error type>.

from magic-wormhole.rs.

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.