1. Franck Bret
  2. CherryPy

Commits

Lakin Wecker  committed df9338a

Allowing SystemExit, and KeyboardInterrupt exceptions through during wspbus.start() without calling stop. (Allows daemonization to function properly). Also log any exceptions which cause start to fail.

  • Participants
  • Parent commits adce8ee
  • Branches default

Comments (0)

Files changed (1)

File cherrypy/restsrv/wspbus.py

View file
         self.log('Bus starting')
         try:
             self.publish('start')
+        except (KeyboardInterrupt, SystemExit):
+            raise
         except:
+            start_trace =  _traceback.format_exc()
+            e_info = sys.exc_info()
             try:
                 self.stop()
             except:
                 # Any stop errors will be logged inside publish().
                 pass
-            raise
+            self.log("Exception that caused shutdown: %s" % start_trace)
+            raise e_info[0], e_info[1], e_info[2]
+
         self.state = states.STARTED
     
     def exit(self, status=0):