Skip to content

Commit

Permalink
Raise 500 error if generic exception
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandrodob committed Jun 8, 2015
1 parent 7d38ada commit a11aebd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pybossa/view/admin.py
Expand Up @@ -28,7 +28,7 @@
from flask.ext.login import login_required, current_user
from flask.ext.babel import gettext
from werkzeug.exceptions import HTTPException
from datetime import datetime
from sqlalchemy.exc import ProgrammingError

from pybossa.model.category import Category
from pybossa.util import admin_required, UnicodeWriter
Expand Down Expand Up @@ -386,8 +386,10 @@ def dashboard():
returning_users_week=returning_users_week,
update_feed=update_feed,
wait=False)
except Exception as e:
current_app.logger.error(e)
except ProgrammingError as e:
return render_template('admin/dashboard.html',
title=gettext('Dashboard'),
wait=True)
except Exception as e: # pragma: no cover
current_app.logger.error(e)
return abort(500)

0 comments on commit a11aebd

Please sign in to comment.