Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2064 (closed defect: fixed)

Opened 10 years ago

Last modified 10 years ago

If a renderer is missing, it is not reported properly and the error message is missleading

Reported by: faide Owned by: cdevienne
Priority: normal Milestone: 2.0b1
Component: TurboGears Version: trunk
Severity: normal Keywords: renderer functions multiple engines
Cc:

Description

If you quickstart a TurboGears2 project and amend the controllers to have a that kind of thing:

 12 class RootController(BaseController):
 13     #admin = DBMechanic(SAProvider(metadata), '/admin')
 14     secc = Secc()
 15
 16     @expose('genshi:testoid.templates.index')
 17     def index(self):
 18         return dict(page='index')
 19
 20     @expose('mako:testoid.templates.about')
 21     def about(self):
 22         return dict(page='about')

This seems to be ok, BUT the default application does not declare mako as a renderer and thus you'll get an error...

The problem is that instead of reporting a missing renderer the tg2 stack will happily report a template lookup error.

We should test if the desired renderer is present and report a MissingRendererError? or something similar, to warn the user that he needs to change his app_cfg.py file and add:

base_config.renderers.append('mako')

in it...

Thoughts?

Attachments

add_missingrenderer_detection.patch Download (1.3 KB) - added by cdevienne 10 years ago.
Patch that fix the issue

Change History

comment:1 Changed 10 years ago by faide

  • Status changed from new to assigned

comment:2 Changed 10 years ago by jorge.vargas

This seems reasonable.

comment:3 Changed 10 years ago by cdevienne

  • Owner changed from faide to cdevienne
  • Status changed from assigned to new

comment:4 Changed 10 years ago by cdevienne

  • Status changed from new to assigned

Changed 10 years ago by cdevienne

Patch that fix the issue

comment:5 Changed 10 years ago by cdevienne

Florent,

The attached patch fix the issue. Can you have a look and commit ?

Thanks,

Christophe

comment:6 Changed 10 years ago by faide

applied in r5876 thanks!

comment:7 Changed 10 years ago by faide

  • Status changed from assigned to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.