GithubHelp home page GithubHelp logo

emit('error') about mapreduce HOT 6 CLOSED

pouchdb avatar pouchdb commented on August 26, 2024
emit('error')

from mapreduce.

Comments (6)

nolanlawson avatar nolanlawson commented on August 26, 2024

We use it in the cases where we want to notify the user of an error, but it's impossible to actually return an error (e.g. a TypeError in a map function and the user set update_after=true).

If you set db.on('error', function (error){/* do something */}, then you can handle the error. Else it will just throw an exception where possible, which is why we were setting db.on('error', function (error){/* noop */} in the tests.

from mapreduce.

neojski avatar neojski commented on August 26, 2024

So I suppose I've broken that functionality.

from mapreduce.

nolanlawson avatar nolanlawson commented on August 26, 2024

Yeah, but that was my bad for not writing a test for it. I believe you just need to change the /* noop */ to confirm that an error was emitted.

from mapreduce.

neojski avatar neojski commented on August 26, 2024

Still wondering what to do with this line:

// just recover

from mapreduce.

nolanlawson avatar nolanlawson commented on August 26, 2024

Presumably it is impossible for an error to be thrown there, since we're putting try/catch around any user code. If an error is thrown, then it's a bug.

So I believe you should be able to remove that implicit "catch" and the tests will still pass.

from mapreduce.

neojski avatar neojski commented on August 26, 2024

Closing in favour of #126.

from mapreduce.

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.