Added 404 Debug handler

This commit is contained in:
ZKWolf
2023-06-14 21:44:15 +02:00
parent 2b68800484
commit 2518da97e1

View File

@@ -26,3 +26,28 @@ def inventory_unlock_special_items():
return jsonify({"status": "error"})
except Exception as e:
graylog_logger(level="error", handler="unknown_unlockSpecialItems", message=str(e))
@app.errorhandler(404)
def debug_404(e):
print("##################################################################################")
print("DEBUG 404")
print("##################################################################################")
print('HTTP Headers:')
for header in request.headers:
print(f'{header[0]}: {header[1]}')
print('Cookies:')
for key, value in request.cookies.items():
print(f'{key}: {value}')
print('Endpoint: ', request.endpoint)
print('Path: ', request.path)
print('Method: ', request.method)
if request.json:
print('JSON Payload:')
print(request.json)
print("##################################################################################")
return jsonify({"status": "error", "code": 404})