Skip to content

Commit

Permalink
[hotfix] explore errors are not raise properly
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Oct 13, 2016
1 parent b785d27 commit 4e9392d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions caravel/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1241,10 +1241,14 @@ def explore(self, datasource_type, datasource_id):
datasources = db.session.query(datasource_class).all()
datasources = sorted(datasources, key=lambda ds: ds.full_name)

viz_obj = self.get_viz(
datasource_type=datasource_type,
datasource_id=datasource_id,
args=request.args)
try:
viz_obj = self.get_viz(
datasource_type=datasource_type,
datasource_id=datasource_id,
args=request.args)
except Exception as e:
flash('{}'.format(e), "alert")
return redirect(error_redirect)

if not viz_obj.datasource:
flash(DATASOURCE_MISSING_ERR, "alert")
Expand Down

0 comments on commit 4e9392d

Please sign in to comment.