changeset 1566:bc235abefd24

LocalSiteMap action: use class exception, not string
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 18 Sep 2006 20:43:30 +0200
parents 6eae21f5f3f9
children 2e1aff91a0a5
files MoinMoin/action/LocalSiteMap.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/LocalSiteMap.py	Mon Sep 18 20:41:08 2006 +0200
+++ b/MoinMoin/action/LocalSiteMap.py	Mon Sep 18 20:43:30 2006 +0200
@@ -26,6 +26,9 @@
 from MoinMoin import wikiutil
 from MoinMoin.Page import Page
 
+class MaxNodesReachedException(Exception):
+    pass
+
 def execute(pagename, request):
     _ = request.getText
     request.emit_http_headers()
@@ -111,14 +114,14 @@
     def new_node(self):
         self.numnodes = self.numnodes + 1
         if self.numnodes == self.maxnodes:
-            raise "max nodes reached"
+            raise MaxNodesReachedException
 
     def build_tree(self, name):
         self.mark_child(name)
         tree = Tree(name)
         try:
             self.recurse_build([tree], 1)
-        except:
+        except MaxNodesReachedException:
             pass
         return tree