GithubHelp home page GithubHelp logo

errorify's People

Contributors

mattdesl avatar zertosh avatar

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

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

mattdesl dwaltrip

errorify's Issues

DOM / CSS

I like the idea of this and would be interested in bringing it into my workflow, but I find Beefy's DOM-based error reporting (using <pre>) to be a bit cleaner and less jarring/disruptive than a modal alert().

There's also more potential for colors, err.stack, etc rather than just a string message.

Are you open to this? Or would you rather it be in another module?

A simple template ends up looking like this: (mostly from Beefy)

function(error) {
  console.error(error)
  var doc = typeof document === 'undefined' ? null : document
  if (!doc)
    return

  if(!doc.body) {
    return doc.addEventListener('DOMContentLoaded', function() {
      output()
    })
  } else
    output()

  function output() {
    var pre = doc.createElement('pre')
    pre.textContent = error
    if (doc.body.children.length)
      doc.body.insertBefore(pre, doc.body.children[0])
    else
      doc.body.appendChild(pre)
  }
}

Error event or something?

Is it possible to emit/catch an error event or something so I can attach a custom callback function to execute in addition to the default console.error (for example trigger a system beep)?

This is my code:

let b = browserify(file, {
    debug: true,
    cache: {},
    packageCache: {}
});

let bundle = () => b.bundle().pipe(fs.createWriteStream(outFile));

b.transform('babelify', {sourceMapsAbsolute: true})
    .transform('brfs')
    .plugin('minifyify', {
        map: `${path.basename(outFile)}.map`,
        output: `${outFile}.map`
    });

bundle();
b.plugin(errorify)
    .plugin(watchify, {poll: true})
    .on('update', bundle)
    .on('log', (msg) => console.log('Bundle %s created. %s', file, msg));

I've tried attaching to .on('error') but it does not get triggered.

babelify@6

The error is no longer so pretty with babelify@6

babel/babelify#72

I can submit a PR that looks something like this:

  var message;
  if (err.codeFrame) { //[email protected]
    message = [err.message, err.codeFrame].join('\n\n');
  } else { //[email protected] and browserify
    message = err.annotated || err.message;
  }

  //normalize error properties
  err = {
    message: message,
    ...

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.