Handle exceptions when building the app (without a try block, you have to manually kill the process if there's an exception during startup)

This commit is contained in:
Nate Coraor
2009-02-03 14:14:02 -05:00
parent 823311a798
commit b401de9c27
+7 -2
View File
@@ -51,8 +51,13 @@ def app_factory( global_conf, **kwargs ):
if 'app' in kwargs:
app = kwargs.pop( 'app' )
else:
from galaxy.app import UniverseApplication
app = UniverseApplication( global_conf = global_conf, **kwargs )
try:
from galaxy.app import UniverseApplication
app = UniverseApplication( global_conf = global_conf, **kwargs )
except:
import traceback, sys
traceback.print_exc()
sys.exit( 1 )
atexit.register( app.shutdown )
# Create the universe WSGI application
webapp = galaxy.web.framework.WebApplication( app, session_cookie='galaxysession' )