diff --git a/main.py b/main.py
index ffcd71e..3833c7a 100644
--- a/main.py
+++ b/main.py
@@ -2,6 +2,7 @@ import cgi
import datetime
import pytz
import html
+import traceback
import workers.conn
import workers.val
@@ -78,7 +79,7 @@ def doConn(req):
except Exception as e:
content = "
500 Internal Server Error
\n"
if "debug" in req.args:
- content += str(e)
+ content += traceback.format_exc().replace("\n", "
")
return Response(HTTP500, HTML, content)
return Response(HTTP200, JSON if req.json else XML, content)
@@ -104,7 +105,7 @@ def doVal(req):
except Exception as e:
content = "500 Internal Server Error
\n"
if "debug" in req.args:
- content += str(e).encode()
+ content += traceback.format_exc().replace("\n", "
")
return Response(HTTP500, HTML, content)
return Response(HTTP200, JSON if req.json else XML, content)
@@ -139,7 +140,7 @@ def doNearby(req):
except Exception as e:
content = "500 Internal Server Error
"
if "debug" in req.args:
- content += repr(e)
+ content += traceback.format_exc().replace("\n", "
")
return Response(HTTP500, HTML, content)
return Response(HTTP200, JSON if req.json else XML, content)
@@ -152,7 +153,7 @@ def doRadar(req):
except Exception as e:
content = "500 Internal Server Error
\n"
if "debug" in req.args:
- content += repr(e)
+ content += traceback.format_exc().replace("\n", "
")
return Response(HTTP500, HTML, content)
return Response(HTTP200, JSON if req.json else XML, content)
@@ -195,7 +196,7 @@ def doDepArr(req):
except Exception as e:
content = "500 Internal Server Error
\n"
if "debug" in req.args:
- content += str(e)
+ content += traceback.format_exc().replace("\n", "
")
return Response(HTTP500, HTML, content)
return Response(HTTP200, JSON if req.json else XML, content)