From 8c28be10410555dddf29c357c91378ffe84db80a Mon Sep 17 00:00:00 2001 From: Michele Comitini Date: Sat, 9 Mar 2013 21:16:58 +0100 Subject: [PATCH 1/3] fixed request missing current prefix causing wrongly handled exceptions. --- NEWINSTALL | 1 - gluon/tools.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 NEWINSTALL diff --git a/NEWINSTALL b/NEWINSTALL deleted file mode 100644 index 8b137891..00000000 --- a/NEWINSTALL +++ /dev/null @@ -1 +0,0 @@ - diff --git a/gluon/tools.py b/gluon/tools.py index 2156d425..e6456f6d 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -4454,7 +4454,7 @@ class Service(object): except BaseException: etype, eval, etb = sys.exc_info() code = -32099 - data = '%s: %s\n' % (etype.__name__, eval) + str(request.is_local and traceback.format_tb(etb)) + data = '%s: %s\n' % (etype.__name__, eval) + str(current.request.is_local and traceback.format_tb(etb)) return return_error(id, code, data=data) except: etype, eval, etb = sys.exc_info() From 8cd6928da35e8cc1cb8cec2eae80817eb198b0ea Mon Sep 17 00:00:00 2001 From: Michele Comitini Date: Sat, 9 Mar 2013 21:21:26 +0100 Subject: [PATCH 2/3] Revert "fixed request missing current prefix causing wrongly handled exceptions." This reverts commit 8c28be10410555dddf29c357c91378ffe84db80a. Removed NEWINSTALL by error. --- NEWINSTALL | 1 + gluon/tools.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 NEWINSTALL diff --git a/NEWINSTALL b/NEWINSTALL new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/NEWINSTALL @@ -0,0 +1 @@ + diff --git a/gluon/tools.py b/gluon/tools.py index e6456f6d..2156d425 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -4454,7 +4454,7 @@ class Service(object): except BaseException: etype, eval, etb = sys.exc_info() code = -32099 - data = '%s: %s\n' % (etype.__name__, eval) + str(current.request.is_local and traceback.format_tb(etb)) + data = '%s: %s\n' % (etype.__name__, eval) + str(request.is_local and traceback.format_tb(etb)) return return_error(id, code, data=data) except: etype, eval, etb = sys.exc_info() From 554eccc14a6dbaed05503b54b74ed974bf74c607 Mon Sep 17 00:00:00 2001 From: Michele Comitini Date: Sat, 9 Mar 2013 21:29:06 +0100 Subject: [PATCH 3/3] fixed request missing current prefix causing wrongly handled exceptions. --- gluon/tools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gluon/tools.py b/gluon/tools.py index 2156d425..3945d854 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -4405,9 +4405,9 @@ class Service(object): + request = current.request + response = current.response if not data: - request = current.request - response = current.response response.headers['Content-Type'] = 'application/json; charset=utf-8' try: data = json_parser.loads(request.body.read())