feat(python): raise error if command service returns error code other than 0

This commit is contained in:
Serik Ibragimov
2024-04-25 19:37:27 +05:00
parent e863fd60f4
commit 9ae6252e53

View File

@ -202,6 +202,10 @@ def commandRequest(method, key, meta=None):
response = requests.post(config_manager.document_server_command_url().geturl(), json=payload, headers=headers,
verify=config_manager.ssl_verify_peer_mode_enabled(), timeout=5)
error = response.json()["error"]
if not error == 0:
raise Exception(f"Command Service Error #{error}")
return response