Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Ability for scraper to push errors down the pipeline without throwing #389

Closed
jzohrab opened this issue Aug 9, 2020 · 2 comments
Closed
Labels
duplicate This issue or pull request already exists enhancement New feature or request from-cds Transferred from https://github.com/covidatlas/coronadatascraper

Comments

@jzohrab
Copy link
Contributor

jzohrab commented Aug 9, 2020

Original issue https://github.com/covidatlas/coronadatascraper/issues/183, transferred here on Friday Mar 20, 2020 at 05:49 GMT


A couple ways this could work:

  1. Scraper called with errors array as an argument that can be pushed to (feels weird man)
  2. Scraper called with this = { errors: [] } (breaks a lot of scrapers)
  3. Scraper called with region array as an argument you can push data to, can throw at any time (i.e. throw at the end of the scraper to indicate a non-fatal error)
  4. Other ways?
@jzohrab jzohrab added enhancement New feature or request from-cds Transferred from https://github.com/covidatlas/coronadatascraper labels Aug 9, 2020
@jzohrab
Copy link
Contributor Author

jzohrab commented Aug 9, 2020

(Transferred comment)

@qgolsteyn @ryanblock thoughts?

@jzohrab
Copy link
Contributor Author

jzohrab commented Aug 9, 2020

(Transferred comment)

What's an example of when this would be useful?

To me, idea 1 errors array isn't bad, it's a collector parameter. Have used such things in the past. Could even be a stream or a logger they push to.

  • Other possibility: global logging, potentially. Scrapers could instantiate a ScraperError(this, err) and give it to a global logger routine. If scrapers know they can continue despite the error, great.

@jzohrab jzohrab added the duplicate This issue or pull request already exists label Aug 9, 2020
@jzohrab jzohrab closed this as completed Aug 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists enhancement New feature or request from-cds Transferred from https://github.com/covidatlas/coronadatascraper
Projects
None yet
Development

No branches or pull requests

1 participant