From 801ed1e6ddda3bf95afac41a35f6d46bbe2fb1f8 Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Tue, 30 Jun 2009 22:11:34 -0800 Subject: [PATCH] if we run into trouble instanciating the class, print it out and continue.. otherwise we would end up w/ an unorder, incomplete container.. [git-p4: depot-paths = "//depot/": change = 1346] --- ContentDirectory.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ContentDirectory.py b/ContentDirectory.py index 22305ad..0a9b04f 100644 --- a/ContentDirectory.py +++ b/ContentDirectory.py @@ -114,7 +114,13 @@ class ContentDirectoryControl(UPnPPublisher, dict): '''If the generated object (by klass) has an attribute content, it is installed into the web server.''' assert isinstance(self[parent], Container) nid = self.getnextID() - i = klass(self, nid, parent, title, *args, **kwargs) + try: + i = klass(self, nid, parent, title, *args, **kwargs) + except: + import traceback + traceback.print_exc() + return + if hasattr(i, 'content'): self.webbase.putChild(nid, i.content) #log.msg('children:', `self.children[parent]`, `i`)