#31239: Add a new exception type for request.GET and request.POST ---------------------------------+-------------------------------------- Reporter: Victor Porton | Owner: (none) Type: New feature | Status: new Component: Error reporting | Version: master Severity: Normal | Resolution: Keywords: | Triage Stage: Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 ---------------------------------+--------------------------------------
Comment (by Victor Porton): @felixxm This your question is also already answered by me: Writing try...except around every `request.GET` and `request.POST` is very cumbersome. So cumbersome that some programmers prefer not to check but just get a 500 Internal Server Error in this case, knowing it is an erroneous behavior. Programming is about automation. Need to automate this checking for the entire program easily. In my code example I show how this automation could be done. Unfortunately if we catch `MultiValueDictKeyError` as in my example, we also "catch" some programming errors, file reading errors, database errors, etc. producing a wrong HTTP status. It is just bad. -- Ticket URL: <https://code.djangoproject.com/ticket/31239#comment:6> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.8dc333fc0f98d8ce5e0e31e8512f4ceb%40djangoproject.com.