Skip to content

Instantly share code, notes, and snippets.

@z4y4ts
Forked from x746e/gist:5612369
Last active December 20, 2015 05:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save z4y4ts/6077942 to your computer and use it in GitHub Desktop.
Save z4y4ts/6077942 to your computer and use it in GitHub Desktop.
diff --git a/gluon/languages.py b/gluon/languages.py
--- a/gluon/languages.py
+++ b/gluon/languages.py
@@ -283,6 +283,7 @@
def write_plural_dict(filename, contents):
+ return
if '__corrupted__' in contents:
return
try:
@@ -303,6 +304,7 @@
def write_dict(filename, contents):
+ return
if '__corrupted__' in contents:
return
try:
diff --git a/gluon/main.py b/gluon/main.py
--- a/gluon/main.py
+++ b/gluon/main.py
@@ -610,6 +610,7 @@
except:
+ raise # the exception will be handled by werkzeug's debug facilities
if request.body:
request.body.close()
@@ -834,6 +835,12 @@
log_filename,
profiler_filename)}
+ from werkzeug.serving import run_simple
+ from werkzeug.debug import DebuggedApplication
+ app = DebuggedApplication(app_info["wsgi_app"], evalex=True)
+ run_simple(ip, port, app, use_reloader=True)
+ return
+
self.server = rocket.Rocket(interfaces or tuple(sock_list),
method='wsgi',
app_info=app_info,
diff --git a/gluon/restricted.py b/gluon/restricted.py
--- a/gluon/restricted.py
+++ b/gluon/restricted.py
@@ -216,13 +216,9 @@
# do not encapsulate (obfuscate) the original RestrictedError
raise
except Exception, error:
- # extract the exception type and value (used as output message)
- etype, evalue, tb = sys.exc_info()
- # XXX Show exception in Wing IDE if running in debugger
- if __debug__ and 'WINGDB_ACTIVE' in os.environ:
- sys.excepthook(etype, evalue, tb)
- output = "%s %s" % (etype, evalue)
- raise RestrictedError(layer, code, output, environment)
+ #from traceback import format_exc
+ #raise HTTP(500, u"<pre>%s</pre>" % format_exc())
+ from raven import Client
+ client = Client('http://446f13430fa34e0e8656d8f289a2d9b7:e23fb3744e59499d97ed4a3f9c5b52c1@choomac.local:9000/2')
+ client.captureException()
+ raise # the exception will be handled by werkzeug's debug facilities
def snapshot(info=None, context=5, code=None, environment=None):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment