#30600: Django is silence on ValueError in converter to_python() method.
-------------------------------------+-------------------------------------
     Reporter:  Fraterius            |                    Owner:  nobody
         Type:  Uncategorized        |                   Status:  new
    Component:  Core (URLs)          |                  Version:  2.2
     Severity:  Normal               |               Resolution:
     Keywords:  url pattern          |             Triage Stage:
  converter regexp                   |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Description changed by Fraterius:

Old description:

> 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).

New description:

 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 returned 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#comment:1>
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/067.cea0a8dd5f3839a8e2b5b5282c3e697b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to