﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30728	Django urls patterns resolver shadowing exceptions thrown everywhere else	Ariel Torti	nobody	"The new version of django somehow captures all the exceptions ocurred while parsing the urlpatterns.

How to reproduce:
  * Create a django project
  * Create a an app

app/views.py
{{{
from django.shortcuts import render

class MyCustomExceptionShadowed(Exception):
  pass

raise MyCustomExceptionShadowed('I have a description of your error')

# Create your views here.
def myview(request):
  pass
}}}

urls.py
{{{
from django.contrib import admin
from django.urls import path

from bugtest import views

urlpatterns = [
    path('', views.myview),
    path('admin/', admin.site.urls),
]

}}}

When running the server I get 

{{{
django.core.exceptions.ImproperlyConfigured: The included URLconf 'bug.urls' does not appear to have any patterns in it. If you see valid patterns in the file then the issue is probably caused by a circular import.
}}}

When in fact I expect it to say 
{{{
  File ""/home/ariel-nt/Desktop/test/bug/bugtest/views.py"", line 6, in <module>
    raise MyCustomExceptionShadowed('I have a description of your error')
bugtest.views.MyCustomExceptionShadowed: I have a description of your error
}}}

I tested this with django 2.1 and it works as expected, so I'll now try to find the root cause of the error and give an update here
The issue in introduced in this commit [https://github.com/django/django/commit/097457afe47e50e76d53b1cd3312ba8364f866cb#diff-46e69f287173eef41fcbfeba05501954R274]
This line [https://github.com/django/django/blob/097457afe47e50e76d53b1cd3312ba8364f866cb/django/utils/autoreload.py#L274] absorbs all the exceptions not showing them to the developer. "	Bug	closed	Utilities	2.2	Release blocker	duplicate		Tom Forbes	Accepted	0	0	0	0	0	0
