Stream errors are printed with full traceback
The stream will now properly print the traceback of an error if the debuging variable is set.
This commit is contained in:
@@ -7,6 +7,7 @@ import sys
|
|||||||
import socket
|
import socket
|
||||||
import time
|
import time
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
import traceback
|
||||||
|
|
||||||
if (sys.version_info > (3, 0)):
|
if (sys.version_info > (3, 0)):
|
||||||
PY_VERSION = 3
|
PY_VERSION = 3
|
||||||
@@ -275,7 +276,7 @@ class BaseClient(Thread):
|
|||||||
# for debugging purposes
|
# for debugging purposes
|
||||||
debug_intent = os.environ.get('PYMODES_DEBUG', None)
|
debug_intent = os.environ.get('PYMODES_DEBUG', None)
|
||||||
if debug_intent.lower() == 'true':
|
if debug_intent.lower() == 'true':
|
||||||
print(sys.exc_info())
|
traceback.print_exc()
|
||||||
sys.exit()
|
sys.exit()
|
||||||
else:
|
else:
|
||||||
print("Unexpected Error:", e)
|
print("Unexpected Error:", e)
|
||||||
|
|||||||
Reference in New Issue
Block a user