]> git.llucax.com Git - software/pymin.git/blobdiff - dispatcher.py
Bugfix: handle empty lists on as_table().
[software/pymin.git] / dispatcher.py
index addd45f716a3446b5fa0078875328eb2cdf37d5c..0284da5c499b03805babd97caec2dda8fa99c5ab 100644 (file)
@@ -27,7 +27,7 @@ class Error(RuntimeError):
         self.command = command
 
     def __str__(self):
-        return ' '.join(self.command)
+        return 'Command not found: "%s"' % ' '.join(self.command)
 
 class CommandNotFoundError(Error):
     r"""
@@ -108,7 +108,7 @@ class Dispatcher:
                 raise CommandNotFoundError(command)
             handler = getattr(handler, route[0])
             route = route[1:]
-        handler(*route)
+        return handler(*route)
 
 
 if __name__ == '__main__':