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

Change to raise 404 error when passing incorrect parameter #3747

Closed
1 task
Tracked by #137
fec-jli opened this issue May 11, 2020 · 2 comments · Fixed by #3830
Closed
1 task
Tracked by #137

Change to raise 404 error when passing incorrect parameter #3747

fec-jli opened this issue May 11, 2020 · 2 comments · Fixed by #3830

Comments

@fec-jli
Copy link
Contributor

fec-jli commented May 11, 2020

Summary

What we have now
When put a bad candidate_id or committee_id on candidate and committee profile page on url,
client will get 500 server error.
example:
https://www.fec.gov/data/candidate/P800015715555555/
https://www.fec.gov/data/committee/C0058010055555/?cycle=2020

Completion criteria:

  • When bad parameters are present, a 404 error should appear, not a 500

What we want?
instead of 500 error, we want to change to raise 404 error

Screen Shot 2020-05-11 at 11 17 56 AM

Screen Shot 2020-05-11 at 11 17 26 AM

@patphongs
Copy link
Member

patphongs commented May 18, 2020

Looks like an incorrect path will get this error, I think if we fix this, we may get a 404?

Test path: http://www.fec.gov/data/candidate/P999/

cycle = max(candidate.get("rounded_election_years"))
AttributeError: 'NoneType' object has no attribute 'get'

@lbeaufort lbeaufort added this to the Sprint 12.5 milestone May 18, 2020
@patphongs patphongs self-assigned this Jun 8, 2020
@rfultz
Copy link
Contributor

rfultz commented Jun 8, 2020

Is it actually a 404, a page not found? Or should we let it throw something like a 400, 417, 300, or a 301 so search engines know not to remember that URL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants