Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why the error with a generic 400/500 error message? #190

Closed
WaylonOKC opened this issue Jun 21, 2023 · 2 comments
Closed

Why the error with a generic 400/500 error message? #190

WaylonOKC opened this issue Jun 21, 2023 · 2 comments

Comments

@WaylonOKC
Copy link

v5 would return the actual error returned by the website.

For example, if you try to scrap https://www.congress.gov/bill/117th-congress/house-bill/2617/text then you will get a 403-Forbidden error.

v6 now catches all 4xx and 5xx errors and returns a generic "Server has returned a 400/500 error code" which is not helpful/useful.

Why hide the actual error?

@jshemas
Copy link
Owner

jshemas commented Jun 22, 2023

Hello,

Fixed in open-graph-scraper@6.2.1

This will now return:

result: {
  success: false,
  requestUrl: 'https://www.congress.gov/bill/117th-congress/house-bill/2617/text',
  error: '403 Forbidden',
  errorDetails: Error: 403 Forbidden
      at requestAndResultsFormatter (/openGraphScraper/lib/request.ts:36:17)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)
      at setOptionsAndReturnOpenGraphResults (/openGraphScraper/lib/openGraphScraper.ts:44:32)
      at run (/openGraphScraper/index.ts:26:15)
}

@WaylonOKC
Copy link
Author

Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants