Successfully built RMASS message push module, sender id resolver from DM room and included processing for 204 HTTP response with no content when handling incoming JSON
This commit is contained in:
@@ -11,11 +11,13 @@ def buildLog (action, outputs, response):
|
||||
|
||||
except: (KeyError, TypeError)
|
||||
|
||||
if action.showstatus is True and response.status_code == 200:
|
||||
if action.showstatus is True and response.status_code in [200, 204]:
|
||||
print(f"{action.name} successful")
|
||||
|
||||
elif action.showstatus is True and response.status_code != 200:
|
||||
elif action.showstatus is True and response.status_code not in [200, 204]:
|
||||
print(f"{action.name} failed with status code {response.status_code}")
|
||||
print(f"Response: {response.json()["error"]}")
|
||||
|
||||
try:
|
||||
print(f"Response: {response.json()["error"]}")
|
||||
except KeyError:
|
||||
print(f"Response:", response.json())
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user