Skip to content

Commit

Permalink
make stack trace more readable (#1672)
Browse files Browse the repository at this point in the history
* make stack trace more readable

* remove ascii_art import

* remove ascii_art.py
  • Loading branch information
Alanna Scott committed Nov 29, 2016
1 parent 56b917a commit 3496a80
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 97 deletions.
1 change: 0 additions & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ exclude_paths:
- "**.gz"
- "env/"
- "tests/"
- "superset/ascii_art.py"
- "superset/assets/images/"
- "superset/assets/vendor/"
- "superset/assets/node_modules/"
Expand Down
1 change: 0 additions & 1 deletion .landscape.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ pep8:
ignore-paths:
- docs
- superset/migrations/env.py
- superset/ascii_art.py
ignore-patterns:
- ^example/doc_.*\.py$
- (^|/)docs(/|$)
82 changes: 0 additions & 82 deletions superset/ascii_art.py

This file was deleted.

7 changes: 3 additions & 4 deletions superset/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from flask_migrate import MigrateCommand
from flask_script import Manager

from superset import app, ascii_art, db, data, security
from superset import app, db, data, security

config = app.config

Expand Down Expand Up @@ -70,11 +70,10 @@ def init():
def version(verbose):
"""Prints the current version number"""
s = (
"\n{boat}\n\n"
"-----------------------\n"
"\n-----------------------\n"
"Superset {version}\n"
"-----------------------").format(
boat=ascii_art.boat, version=config.get('VERSION_STRING'))
version=config.get('VERSION_STRING'))
print(s)
if verbose:
print("[DB] : " + "{}".format(db.engine))
Expand Down
12 changes: 8 additions & 4 deletions superset/templates/superset/traceback.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<html>
<body>
<h1>Sorry, something went wrong</h1>
<h3>500 - Internal Server Error</h3>
<hr>
<h2>Stacktrace</h2>
<hr>
<code>
<pre>{{ art }}
{{ title }}
{{ error_msg }}
</pre>
<pre>
{{ error_msg }}
</pre>
</code>
</body>
</html>
8 changes: 3 additions & 5 deletions superset/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import superset
from superset import (
appbuilder, cache, db, models, viz, utils, app,
sm, ascii_art, sql_lab, results_backend, security,
sm, sql_lab, results_backend, security,
)
from superset.source_registry import SourceRegistry
from superset.models import DatasourceAccessRequest as DAR
Expand Down Expand Up @@ -2542,12 +2542,10 @@ def refresh_datasources(self):

@app.errorhandler(500)
def show_traceback(self):
error_msg = get_error_msg()
return render_template(
'superset/traceback.html',
error_msg=error_msg,
title=ascii_art.stacktrace,
art=ascii_art.error), 500
error_msg=get_error_msg(),
), 500

@expose("/welcome")
def welcome(self):
Expand Down

0 comments on commit 3496a80

Please sign in to comment.