joestump / django-ajax

A simple framework for creating AJAX endpoints in Django.
http://github.com/joestump/django-ajax
BSD 3-Clause "New" or "Revised" License
260 stars 53 forks source link

endpoint_loader should not eat ImportError #29

Closed claymation closed 12 years ago

claymation commented 12 years ago

The endpoint_loader dynamically imports modules based on the URL:

try:
    module = import_module('%s.endpoints' % application)
except ImportError, e:
    raise AJAXError(404, _('AJAX endpoint does not exist.'))

The trouble with this is that programming errors (syntax errors and such like that would prevent the endpoints module from being imported) are disguised as client errors, making debugging unnecessarily complicated. Perhaps, when DEBUG is set, simply raise the ImportError.