Code Monkey home page Code Monkey logo

Comments (6)

pluma avatar pluma commented on June 7, 2024

I'm not sure I follow. What is happening and what should be happening?

from arangojs.

pekeler avatar pekeler commented on June 7, 2024

In node, exceptions in asynchronous code is typically bubbling up to the nearest exception handler. If there isn't a handler, the node process prints detailed information about the exception before terminating.

It seems that something in this adapter is wrapping callbacks in an exception handler. I expect my little example to terminate with a ReferenceError: programmer is not defined, but it doesn't. My callback is just ending quietly and the process continuous to run.

from arangojs.

pekeler avatar pekeler commented on June 7, 2024

Over the weekend, I've refactored my code from callbacks to promises, which are behaving correctly. So I'm not affected by this exceptions-in-callbacks-incorrectly-being-caught issue anymore.

from arangojs.

pluma avatar pluma commented on June 7, 2024

Which JS environment are you using? I'm guessing this problem occurs when promises are supported (e.g. latest Chrome or node 0.12) and you're using the errbacks instead.

Basically, the errback will be invoked in the promise's then method. Exceptions in that method will result in the promise returned by that method to be rejected but nothing else. As the promise is silently discarded, the error simply vanishes.

from arangojs.

pluma avatar pluma commented on June 7, 2024

I've adjusted the logic so the errback is invoked outside the promise logic. This should give you the behaviour you're expecting.

from arangojs.

pekeler avatar pekeler commented on June 7, 2024

iojs v2.2.1

from arangojs.

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.