LibraryOfCongress / api.congress.gov

congress.gov API
601 stars 38 forks source link

(bill details): requesting a bill that does not exist returns 500 #232

Open ryparker opened 2 months ago

ryparker commented 2 months ago

When requesting details for a bill that does not exist the API returns a 500. I expected this to return 404.

e.g.

curl --location 'https://api.congress.gov/v3/bill/118/s/2?format=json&api_key=<API_KEY>'

Returns 500:

{
    "error": "cannot access local variable 'bill' where it is not associated with a value (UnboundLocalError)",
    "request": {
        "billNumber": "2",
        "billType": "s",
        "congress": "118",
        "contentType": "application/json",
        "format": "json"
    }
}
apreiter18 commented 2 months ago

Thanks, @ryparker - we are investigating.