Skip to content

Instantly share code, notes, and snippets.

@saper
Created May 4, 2015 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saper/67d2bd6a6cd81ee9773a to your computer and use it in GitHub Desktop.
Save saper/67d2bd6a6cd81ee9773a to your computer and use it in GitHub Desktop.
var request = require('request')
request.on('init', function(er) {console.log('starting')})
request.on('initialized', function(er) {console.log('ready to go')})
request.on('error', function(er) {console.log('first error handler')})
var z = request.on('error', function(er) { console.log('second error handler')}).get('aaa');
starting
first error handler
second error handler
ready to go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment