Skip to content

Error checks on network calls, try/catch, etc #438

@Joshfindit

Description

@Joshfindit

Related to #429 but happened to me in a few other situations (accessing from a VPS without a proxy)

I think it would be helpful to add checks and catches to any network calls:

  • Bad response code
  • Empty reply (this was the case for "no element found")
  • Response contents start with <!DOCTYPE html> when the expected reply is JSON (this is likely in the case of a text/HTML warning from YT when they make assumptions that it's someone writing a script)
  • Parsing response body fails due to invalid structure

If it's welcome, can I create a long-running feature branch for network error handling? I'll wrap the calls one at a time, keep it synced with main, and you can merge my progress incrementally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions