#30318: Add new system check message when custom error handler 'path.to.view'
cannot be imported
-------------------------------------+-------------------------------------
     Reporter:  Alasdair Nicol       |                    Owner:  Alasdair
                                     |  Nicol
         Type:  Bug                  |                   Status:  assigned
    Component:  Core (System         |                  Version:  2.2
  checks)                            |
     Severity:  Release blocker      |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Description changed by Alasdair Nicol:

Old description:

> #29642 added checks for the signatures of custom error handlers.
>
> When the 'path.to.view' cannot be imported, it raises
> ModuleNotFoundError, as seen in this Stack Overflow question
>
> https://stackoverflow.com/q/55481810/113962
>
> I suggest we catch the ModuleNotFoundError, and add another check code,
> e.g.
>
> * **urls.E008**: The custom ``handlerXXX`` view ``'path.to.view'`` cannot
> be imported.

New description:

 #29642 added checks for the signatures of custom error handlers.

 When the 'path.to.view' cannot be imported, it raises ModuleNotFoundError
 or ViewDoesNotExist, as seen in this Stack Overflow question:

 https://stackoverflow.com/q/55481810/113962

 I suggest we catch the exception, and add another check code, e.g.

 {{{
 * **urls.E008**: The custom ``handlerXXX`` view ``'path.to.view'`` cannot
 be imported.
 }}}

--

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30318#comment:3>
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/071.540cfcb9ed7e59c7864e4e2ab3874b97%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to