Browse files

Raise a useful error message if template can't be found.

  • Loading branch information...
1 parent f961ab0 commit 060db3995a89567fb33fe21db424c9976e4482fc Michael Gorven committed Jul 11, 2011
Showing with 2 additions and 0 deletions.
  1. +2 −0 web/contrib/template.py
View
2 web/contrib/template.py
@@ -146,6 +146,8 @@ def _get_template(self, name, from_template=None):
def __getattr__(self, name):
template = self._get_template(name)
+ if not template:
+ raise AttributeError('Template "%s" not found.' % name)
def render(*args, **kwargs):
import web
if 'headers' in web.ctx and template.content_type:

0 comments on commit 060db39

Please sign in to comment.