Skip to content

Commit

Permalink
REF: remove traceback from error code, it might cause a security risk…
Browse files Browse the repository at this point in the history
…. Fix any errors on the backend side.
  • Loading branch information
pavlov99 committed Oct 28, 2017
1 parent 2781578 commit 027e432
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
5 changes: 0 additions & 5 deletions jsonrpc/manager.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import sys
import traceback
import json
import logging
from .utils import is_invalid_params
Expand Down Expand Up @@ -115,9 +113,6 @@ def response(**kwargs):
"type": e.__class__.__name__,
"args": e.args,
"message": str(e),
"traceback": ''.join(
traceback.format_exception(*sys.exc_info())
),
}

logger.exception("API Exception: {0}".format(data))
Expand Down
7 changes: 0 additions & 7 deletions jsonrpc/tests/test_manager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os
import sys

from ..manager import JSONRPCResponseManager
Expand Down Expand Up @@ -133,9 +132,6 @@ def test_server_error(self):
response.error["data"]['args'], ('error_explanation',))
self.assertEqual(
response.error["data"]['message'], "'error_explanation'")
self.assertIn('traceback', response.error["data"])
self.assertIn(
os.path.basename(__file__), response.error["data"]['traceback'])

def test_notification_calls_method(self):
request = JSONRPC20Request("long_time_method", is_notification=True)
Expand Down Expand Up @@ -169,9 +165,6 @@ def test_type_error_inside_method(self):
response.error["data"]['args'], ('TypeError inside method',))
self.assertEqual(
response.error["data"]['message'], 'TypeError inside method')
self.assertIn('traceback', response.error["data"])
self.assertIn(
os.path.basename(__file__), response.error["data"]['traceback'])

def test_invalid_params_before_dispatcher_error(self):
request = JSONRPC20Request(
Expand Down

0 comments on commit 027e432

Please sign in to comment.