Created
July 20, 2012 00:18
-
-
Save mrjf/3147852 to your computer and use it in GitHub Desktop.
Causes error: events.js:66 throw arguments[1]; // Unhandled 'error' event ^ Error: Parse Error at Socket.socketOnData (http.js:1356:20) at TCP.onread (net.js:404:27)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| request = require 'request' | |
| urls = ('123fastpay.com' for i in [1..35]) | |
| for url in urls | |
| try | |
| request 'http://' + url, (error, response, body) -> | |
| console.log 'url is back:', response | |
| catch error | |
| console.log error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Generated by CoffeeScript 1.3.1 | |
| (function() { | |
| var i, request, url, urls, _i, _len; | |
| request = require('request'); | |
| urls = (function() { | |
| var _i, _results; | |
| _results = []; | |
| for (i = _i = 1; _i <= 35; i = ++_i) { | |
| _results.push('123fastpay.com'); | |
| } | |
| return _results; | |
| })(); | |
| for (_i = 0, _len = urls.length; _i < _len; _i++) { | |
| url = urls[_i]; | |
| try { | |
| request('http://' + url, function(error, response, body) { | |
| return console.log('url is back:', response); | |
| }); | |
| } catch (error) { | |
| console.log(error); | |
| } | |
| } | |
| }).call(this); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ node case.js | |
| url is back: undefined | |
| url is back: undefined | |
| url is back: undefined | |
| url is back: undefined | |
| url is back: undefined | |
| url is back: undefined | |
| url is back: undefined | |
| url is back: undefined | |
| url is back: undefined | |
| url is back: undefined | |
| url is back: undefined | |
| url is back: undefined | |
| url is back: undefined | |
| url is back: undefined | |
| url is back: undefined | |
| events.js:66 | |
| throw arguments[1]; // Unhandled 'error' event | |
| ^ | |
| Error: Parse Error | |
| at Socket.socketOnData (http.js:1356:20) | |
| at TCP.onread (net.js:404:27) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment