node-google-finance icon indicating copy to clipboard operation
node-google-finance copied to clipboard

Breaks when symbol doesn't exist

Open Stono opened this issue 8 years ago • 1 comments

[ 'LON:VM', 'LON:BARC', 'LON:IDONTEXIST' ]

Unhandled rejection StatusCodeError: 400 - "<meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">

Error 400 (Not Found)!!1<div id="af-error-container">

400. That’s an error.

The requested URL was not found on this server. That’s all we know." at new StatusCodeError (/Users/kstoney/Development/stono/stocknet/sn.crawl.news/node_modules/request-promise-core/lib/errors.js:32:15) at Request.plumbing.callback (/Users/kstoney/Development/stono/stocknet/sn.crawl.news/node_modules/request-promise-core/lib/plumbing.js:104:33) at Request.RP$callback as _callback at Request.self.callback (/Users/kstoney/Development/stono/stocknet/sn.crawl.news/node_modules/request/request.js:187:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) at Request. (/Users/kstoney/Development/stono/stocknet/sn.crawl.news/node_modules/request/request.js:1044:10) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at IncomingMessage. (/Users/kstoney/Development/stono/stocknet/sn.crawl.news/node_modules/request/request.js:965:12) at emitNone (events.js:91:20) at IncomingMessage.emit (events.js:185:7) at endReadableNT (_stream_readable.js:934:12) at _combinedTickCallback (internal/process/next_tick.js:74:11) at process._tickCallback (internal/process/next_tick.js:98:9)

Stono avatar Oct 05 '16 10:10 Stono

Use request instead of request-promise at line 29 in lib/utils.js temprorarily solved this. btw pipe streaming is discouraged when using request-promise, maybe the downloadRSS function could be written in another way?

var requestCb = require('request')
var req = requestCb(_.extend({
  uri: uri,
  qs: qs
}, optionalHttpRequestOptions));

thstarshine avatar Jan 08 '17 08:01 thstarshine