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 #2227 (closed enhancement: fixed)

Opened 10 years ago

Last modified 9 years ago

Request: better error message when template path has missing component

Reported by: Kylotan Owned by:
Priority: normal Milestone: 2.1rc1
Component: TurboGears Version: 2.0b5
Severity: normal Keywords:
Cc:

Description

If part of the dotted notation template path is wrong or missing, you see a confusing ImportError?, despite not having explicitly asked to import anything. This would appear to be a 'leaky abstraction' from the package-based implementation of hierarchical template paths. Additionally, the call stack is hard to debug because it does not contain any reference to the file that causes the error (eg. the controller with the wrong template path).

It would probably be possible to catch this exception nearer where it is thrown and re-throw a prettier one?

Sample trivial controller:

@expose(template="projectname.templates.spurious.index")
def index(self):
    return dict()

Note that there would be no 'spurious' directory under the templates directory.

Call stack attached.

Attachments

tg_stack.txt Download (4.7 KB) - added by Kylotan 10 years ago.
Callstack demonstrating cryptic error

Change History

Changed 10 years ago by Kylotan

Callstack demonstrating cryptic error

comment:1 Changed 10 years ago by mramm

  • Milestone changed from 2.0rc1 to 2.0b6

comment:2 Changed 10 years ago by Kylotan

Just as an addendum, and this is obvious really, you also see this if the directory in question does exist, but does not contain the init.py file to designate it as a module.

comment:3 Changed 10 years ago by mramm

  • Milestone changed from 2.0rc1 to 2.1

comment:4 Changed 10 years ago by percious

  • Status changed from new to closed
  • Resolution set to fixed

comment:5 Changed 9 years ago by percious

  • Milestone changed from 2.1 to 2.1rc1
Note: See TracTickets for help on using tickets.