Git Product home page Git Product logo

panic-server's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

panic-server's Issues

Async errors aren't reported

If a job throws an error asynchronously, the panic coordinator won't be notified (however node.js will log an error message, or call 'uncaughtException' on it's process).

Example:

function error (done) {
  setTimeout(function () {
    throw new Error('Out of bacon.')
  }, 1000)
}

// Run the jobs in parallel
panic.clients.run(error)
panic.clients.run(error)

// The promise resolves

Since the jobs are asynchronously parallel, it'd be pretty difficult to track down which job it belongs to, and report back to that job ID - but I've got an idea!

Solution?
Use the line number. window.onerror is supported in IE6, and will always pass the line number as the third param, which can be used to look up the job. Since we have the luxury of using eval, each job function could be prefixed by a bunch of whitespace, creating a fake "file" that addresses job instances by the line space they occupy.

So: 500 newlines prefixed to a 10 line function. We address the job instance as 500-510. If anything calls the global error handler ('uncaughtException' or window.onerror), grab the line number (say 507), go to the lookup "table", and see what job corresponds to that space. If it exists, call job.fail(error), otherwise ignore it.

Admittedly hacky, but it just might work.

Bluebird is unneeded

The bluebird dependency used within this package is unneeded in modern javascript engines. All I've tested recently include native promises.

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.