Separated listener by introducing create listener. Working State. Message loop prevention filters added to server

This commit is contained in:
Lyncoln
2026-10-17 03:42:46 -04:00
parent d260d3681e
commit c7628df30e
14 changed files with 84 additions and 51 deletions
+13 -6
View File
@@ -9,15 +9,22 @@ def buildLog (action, outputs, response):
f"{outputs[print_key]}",
)
except: (KeyError, TypeError)
except (KeyError, TypeError):
pass
if action.showstatus is True and response.status_code in [200, 204]:
if action.showstatus is True and response.ok:
print(f"{action.name} successful")
elif action.showstatus is True and response.status_code not in [200, 204]:
elif action.showstatus is True and not response.ok:
print(f"{action.name} failed with status code {response.status_code}")
try:
print(f"Response: {response.json()["error"]}")
except KeyError:
print(f"Response:", response.json())
response_data = response.json()
except ValueError:
response_data = response.text
if isinstance(response_data, dict):
print("Response:", response_data.get("error", response_data))
else:
print("Response:", response_data)
return