Skip to content

Commit

Permalink
display the right error when a worker can't be used.
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitc committed Oct 28, 2010
1 parent f92a540 commit 47e87df
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
7 changes: 6 additions & 1 deletion gunicorn/app/base.py
Expand Up @@ -117,7 +117,12 @@ def run(self):
raise

self.configure_logging()
Arbiter(self).run()
try:
Arbiter(self).run()
except RuntimeError, e:
sys.stderr.write("\nError: %s\n\n" % e)
sys.stderr.flush()
sys.exit(1)

def configure_logging(self):
"""\
Expand Down
6 changes: 4 additions & 2 deletions gunicorn/workers/geventlet.py
Expand Up @@ -7,8 +7,10 @@


import os

import eventlet
try:
import eventlet
except ImportError:
raise RuntimeError("You need eventlet installed to use this worker.")
from eventlet import hubs
from eventlet.greenio import GreenSocket

Expand Down
6 changes: 4 additions & 2 deletions gunicorn/workers/ggevent.py
Expand Up @@ -12,8 +12,10 @@
if sys.platform == "darwin":
os.environ['EVENT_NOKQUEUE'] = "1"


import gevent
try:
import gevent
except ImportError:
raise RuntimeError("You need gevent installed to use this worker.")
from gevent.pool import Pool
from gevent.server import StreamServer
from gevent import pywsgi, wsgi
Expand Down
5 changes: 4 additions & 1 deletion gunicorn/workers/gtornado.py
Expand Up @@ -6,7 +6,10 @@
import os
import sys

import tornado.web
try:
import tornado.web
except ImportError:
raise RuntimeError("You need tornado installed to use this worker.")
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop, PeriodicCallback
from tornado.wsgi import WSGIContainer
Expand Down

0 comments on commit 47e87df

Please sign in to comment.