changeset 4526:1d06e13ce1ee

web.frontend: the flup CGIRequest uses sys.exit(0) to terminate so we should not run into an exception by that.
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sun, 01 Feb 2009 22:42:33 +0100
parents b29b90a71625
children 699fed126481
files MoinMoin/web/frontend.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/web/frontend.py	Sun Feb 01 21:56:29 2009 +0100
+++ b/MoinMoin/web/frontend.py	Sun Feb 01 22:42:33 2009 +0100
@@ -40,9 +40,13 @@
 
         try:
             self.run_server(application, options)
+        except SystemExit, err:
+            # the flup CGIRequest uses sys.exit(0) to terminate
+            if err.code: # log a non-zero exit status (0 means no error)
+                logging.exception('A SystemExit(%d) exception occurred.' % err.code)
+            raise # exit now with this exit status
         except:
-            logging.error('Error while running %s', self.__class__.__name__)
-            raise
+            logging.exception('An exception occurred while running %s' % self.__class__.__name__)
 
 class ServerFrontEnd(FrontEnd):
     def add_options(self):