646e62 / legal-citation-parser

Unpacks legal case metadata from CanLII case citations.
https://pypi.org/project/legal-citation-parser/
GNU General Public License v3.0
2 stars 0 forks source link

Broken case error handling #36

Closed 646e62 closed 3 months ago

646e62 commented 3 months ago

Some cases on CanLII don't have URLs that correspond to the usual formula. Most of the time, this is because the case uses a CanLII number as a URL rather than the neutral citation. This bug currently crashes the system, but it should be avoidable by running the verify_url kwarg by default.

646e62 commented 3 months ago

Verifying the URL checks to see if the case will cause an issue during the API call. URL verification is off by default to avoid needlessly pinging the website, but could be activated if the program encounters this error.

646e62 commented 3 months ago

Started to run into "too many requests" errors with the verify_url kwarg after just a few pings.

646e62 commented 3 months ago

Adding a new "error" key/value pair to the return (default to None) addresses this problem and paves the way for future, more robust error handling.