#30600: Django is silence on ValueError in converter to_python() method.
-------------------------------------+-------------------------------------
Reporter: Fraterius | Owner: nobody
Type: | Status: new
Uncategorized |
Component: Core | Version: 2.2
(URLs) | Keywords: url pattern
Severity: Normal | converter regexp
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Yesterday I've been debugging for few hours my regexp in Converter class
which seems to be not working correctly, when the real problem was my
Converter's to_python() method which doesn't handle ValueError.
Django instead letting me know where lies the problem simply didn't find
matching pattern and return 404 (so it acted like a regexp problem).
The line responsible for that is:
https://github.com/django/django/blob/26d16c07fdc4a297daca554afa6375c70d6d82a9/django/urls/resolvers.py#L256
I think this should be handled in different manner. At least some note in
the documentation letting user know that all ValueError's in Converters
method are handled silently (which is somehow not intuitive).
--
Ticket URL: <https://code.djangoproject.com/ticket/30600>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/052.0703795577df11c3ff3b862f63c727df%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.