amitu / importd

django based mini framework inspired from sinatra. fully compatible with django.
http://amitu.com/importd/
BSD 3-Clause "New" or "Revised" License
510 stars 30 forks source link

on imports of view/models etc, if file exists and some exception comes, report it #57

Closed amitu closed 9 years ago

amitu commented 9 years ago

As of now if views.py has any error whatsoever, the view fails to import with no trace of error reporting.

if1live commented 9 years ago

Could you show me your code? I'll try it.

amitu commented 9 years ago

Consider line 451 onwards in importd/__init__.py, you see we have imported views etc, but then on exception we eat the exception without reporting it.

What happened was I had some syntax error or import error in my views, and importd stopped importing the view, without giving me any error messages.

To debug this I had to manually modify importd/init.py and put logging statements on each import error there. Which was too verbose.

So I think the right balance is we should check if the file exists, if so then report whatever exception came, else be silent.

amitu commented 9 years ago

Closed in #58.