Permalink
Browse files

make stack trace more readable (#1672)

* make stack trace more readable

* remove ascii_art import

* remove ascii_art.py
  • Loading branch information...
1 parent 56b917a commit 3496a80f5a85a0b66e59ec259ed13ca9ba3d5ba0 @ascott ascott committed on GitHub Nov 29, 2016
Showing with 14 additions and 97 deletions.
  1. +0 −1 .codeclimate.yml
  2. +0 −1 .landscape.yml
  3. +0 −82 superset/ascii_art.py
  4. +3 −4 superset/cli.py
  5. +8 −4 superset/templates/superset/traceback.html
  6. +3 −5 superset/views.py
View
@@ -27,7 +27,6 @@ exclude_paths:
- "**.gz"
- "env/"
- "tests/"
-- "superset/ascii_art.py"
- "superset/assets/images/"
- "superset/assets/vendor/"
- "superset/assets/node_modules/"
View
@@ -17,7 +17,6 @@ pep8:
ignore-paths:
- docs
- superset/migrations/env.py
- - superset/ascii_art.py
ignore-patterns:
- ^example/doc_.*\.py$
- (^|/)docs(/|$)
View
@@ -1,82 +0,0 @@
-from __future__ import absolute_import
-from __future__ import division
-from __future__ import print_function
-from __future__ import unicode_literals
-
-error = (
-"MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM\n"+
-"MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM\n"+
-"MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM8OI++=~~~~~~=+?IODMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM\n"+
-"MMMMMMMMMMMMMMMMMMMMMMMMMD$~~~~~~~~~~~~~~~~~~~~~~~=$MMMMMMMMMMMMMMMMMMMMMMMMMMMM\n"+
-"MMMMMMMMMMMMMMMMMMMMMMN8?:~~~~~~~~~~~~~~~~~~~~~~~~~~=+8NMMMMMMMMMMMMMMMMMMMMMMMM\n"+
-"MMMMMMMMMMMMMMMMMMMMO=~~~~~~~~~~~~~~~~~+I??~~~~~~~~~~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MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM\n"+
-"MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM\n"+
-"MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM")
-
-stacktrace="""
--------------------------------------------------------------------------------------------------------
-=======================================================================================================
--------------------------------------------------------------------------------------------------------
- ___ ___ ___
- ( ) ( ) ( )
- .--. | |_ .---. .--. | | ___ | |_ ___ .-. .---. .--. .--.
- / _ \ ( __) / .-, \ / \ | | ( ) ( __) ( ) \ / .-, \ / \ / \\
- . .' `. ; | | (__) ; | | .-. ; | | ' / | | | ' .-. ; (__) ; | | .-. ; | .-. ;
- | ' | | | | ___ .'` | | |(___) | |,' / | | ___ | / (___) .'` | | |(___) | | | |
- _\_`.(___) | |( ) / .'| | | | | . '. | |( ) | | / .'| | | | | |/ |
-( ). '. | | | | | / | | | | ___ | | `. \ | | | | | | | / | | | | ___ | ' _.'
- | | `\ | | ' | | ; | ; | | '( ) | | \ \ | ' | | | | ; | ; | | '( ) | .'.-.
- ; '._,' ' ' `-' ; ' `-' | ' `-' | | | \ . ' `-' ; | | ' `-' | ' `-' | ' `-' /
- '.___.' `.__. `.__.'_. `.__,' (___ ) (___) `.__. (___) `.__.'_. `.__,' `.__.'
-
--------------------------------------------------------------------------------------------------------
-=======================================================================================================
--------------------------------------------------------------------------------------------------------
-"""
-
-boat = """\
- + +
- )`.).
- )``)``) .~~
- ).-'.-')|)
- |-).-).-'_'-/
- ~~~\ `o-o-o' /~~~~
- ~~~'---.____/~~~"""
View
@@ -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
@@ -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))
@@ -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>
View
@@ -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
@@ -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):

0 comments on commit 3496a80

Please sign in to comment.