Return the trace if an exception occurred

This commit is contained in:
Yoshi Askharoun
2021-05-31 16:04:19 -05:00
parent 44488c86de
commit a6b4b3bfcb
+4
View File
@@ -16,6 +16,7 @@ musicbrainzngs.set_useragent("Zune", "4.8", "https://github.com/yoshiask/PyZuneC
@app.route(f"/v2/<string:locale>/account/signin", methods=['POST'])
def account_signin(locale: str):
try:
print(request.data)
signinReq: Document = xml.parseString(request.data.decode('utf-8'))
tunerInfo: Element = signinReq.firstChild
@@ -31,6 +32,9 @@ def account_signin(locale: str):
# doc.appendChild(feed)
xml_str = doc.toprettyxml(indent="\t")
return Response(xml_str, mimetype=MIME_XML)
except Exception as e:
import traceback
return Response(traceback.format_exc(), status=500, mimetype="text/plain")
if __name__ == "__main__":