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

Error management #27

Merged
merged 6 commits into from
Jun 3, 2024
Merged

Conversation

NauelSerraino
Copy link
Contributor

@NauelSerraino NauelSerraino commented May 31, 2024

Edited errors:

  • PageCheckFailedError -> inherits the error message from the _fetch_first_page_results_number function
    Simulated behaviour of the error:
  File "C:\Users\EDGAR\edgar_tool\text_search.py", line 487, in _fetch_first_page_results_number
    raise PageCheckFailedError(
edgar_tool.page_fetcher.PageCheckFailedError: 
Error for url https://efts.sec.gov/LATEST/search-index?q=Test+Search&dateRange=custom&startdt=2019-06-02&enddt=2024-05-31&page=1, with code 200. Please verify that the search/wait/retry parameters are correct and try again.
  • NoResultsFoundError -> same here from _parse_number_of_results
    Simulated behaviour of the error:
  File "C:\Users\EDGAR\edgar_tool\text_search.py", line 500, in _fetch_first_page_results_number
    raise NoResultsFoundError(
edgar_tool.page_fetcher.NoResultsFoundError: 
Execution aborting due to a NoResultsFoundError error raised while parsing number of results for first page at URL https://efts.sec.gov/LATEST/search-index?q=Test+Search&dateRange=custom&startdt=2019-06-02&enddt=2024-05-31&page=1: no results to parse

@GalenReich GalenReich linked an issue May 31, 2024 that may be closed by this pull request
Copy link
Collaborator

@GalenReich GalenReich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks @NauelSerraino 🙌

@GalenReich GalenReich merged commit d7a2368 into bellingcat:main Jun 3, 2024
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

Successfully merging this pull request may close these issues.

Replace sys.exit with exceptions and handling
2 participants