Giter Site home page Giter Site logo

Comments (7)

squaremo avatar squaremo commented on August 27, 2024

Are you using only rabbit.js? This error probably means testNODE has been declared from elsewhere, e.g., by using the Node AMQP client directly at some point. rabbit.js more or less assumes that won't be the case; i.e., that it has free range to declare what it likes (all AMQP programs have to assume this, in practice).

from rabbit.js.

duartemadueno avatar duartemadueno commented on August 27, 2024

Yes, i'm only using rabbit.js. I know why the error is being thrown but would like to handle that specific exception so i can return a custom message to the client.

The solution was:

  • process.on('uncaughtException', function (err) {});

Anyway, this isn't the best solution, as you might see.

from rabbit.js.

squaremo avatar squaremo commented on August 27, 2024

Ah I see. It's quite tricky to handle AMQP errors, since any error tends to invalidate the AMQP channel, meaning you have to construct a new one and start things again. But you are right that rabbit.js could probably do a lot better than let exceptions be unhandled all the way up.

from rabbit.js.

duartemadueno avatar duartemadueno commented on August 27, 2024

Since this is just a small project there's no problem working things this way but, it's true, would really handy if we could handle AMQP errors through rabbit.js

Another thing, hope you guys don't mind but i changed socket.js file so it can receive a RoutingKey on write. In my case, i don't know which RoutingKeys will be used by the client.

from rabbit.js.

squaremo avatar squaremo commented on August 27, 2024

@duartemadueno master branch now has error reporting on sockets; basically, if an AMQP channel reports an error, any socket using it will emit an error and close. If you've not moved on from rabbit.js, would you try it out to see if it works like you'd expect? Extra test cases very welcome. Thanks!

from rabbit.js.

duartemadueno avatar duartemadueno commented on August 27, 2024

Hi @squaremo right now i'm using https://github.com/postwait/node-amqp and that solved my problem. Sorry i can't help you on this particular issue

from rabbit.js.

squaremo avatar squaremo commented on August 27, 2024

No worries! I understand -- it's more flexible using node-amqp directly, if a bit more work too.
Thanks for pointing out the problem in the first place.

from rabbit.js.

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.