matthewmueller/x-ray

Can't catch an error thrown when there's an invalid status code 522

Ouverte

#90 ouverte le 2 sept. 2015

 (1 commentaire) (1 réaction) (0 personne assignée)JavaScript (415 forks)batch import
bughelp wanted

Métriques du dépôt

Stars
 (5 804 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

Hi,

I'm trying to scrape the url below but after some time it shows an error: http://www.lazygamer.net/boost/the-top-10-gaming-youtubers-in-2014-so-far/

assert.js:86
  throw new assert.AssertionError({
        ^
AssertionError: invalid status code: 522
    at Object.status (/Users/jonathan/git/youtube_urls_from_url/node_modules/x-ray/node_modules/http-context/lib/response.js:81:5)
    at context.status (/Users/jonathan/git/youtube_urls_from_url/node_modules/x-ray/node_modules/http-context/node_modules/delegates/index.js:92:31)
    at /Users/jonathan/git/youtube_urls_from_url/node_modules/x-ray/node_modules/x-ray-crawler/lib/http-driver.js:30:20
    at Request.callback (/Users/jonathan/git/youtube_urls_from_url/node_modules/x-ray/node_modules/x-ray-crawler/node_modules/superagent/lib/node/index.js:797:3)
    at IncomingMessage.<anonymous> (/Users/jonathan/git/youtube_urls_from_url/node_modules/x-ray/node_modules/x-ray-crawler/node_modules/superagent/lib/node/index.js:990:12)
    at IncomingMessage.emit (events.js:129:20)
    at _stream_readable.js:908:16
    at process._tickCallback (node.js:355:11)

I also attached a screenshot of the webpage loaded from the browser if it's helpful.

Guide contributeur