Giter Site home page Giter Site logo

Comments (4)

squaremo avatar squaremo commented on May 20, 2024

Commit c007e43 adds error handling to the callback RPC machinery. Specifically, it redirects errors thrown in callbacks to channel 'error' events (thereby closing the channel).

Arguably this diverges from the semantics of the promise API: there, an error thrown in a success continuation won't break the channel, though it will of course result in an error continuation being called. There's no obvious other way to surface errors in the callback API, but I wonder if it's appropriate for the promise API to do the analogous thing and close the channel, or even whether it's possible -- maybe not, thinking about it.

from amqplib.

squaremo avatar squaremo commented on May 20, 2024

Actually, I don't think redirecting errors is the right thing to do. If an error is thrown in callback code, it should crash. 'error' should be reserved for operational errors, that is, the socket closing and what have you.

from amqplib.

gjohnson avatar gjohnson commented on May 20, 2024

I agree, node-amqp does the former and it's difficult to tell whether an error is due to network conditions or you app level code sucking. Wrote some thoughts on this a few months back: https://gist.github.com/gjohnson/7566343

from amqplib.

squaremo avatar squaremo commented on May 20, 2024

I reverted this in ae5a495

from amqplib.

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.