mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-02-10 18:05:10 +08:00
feat(python): raise error if command service returns error code other than 0
This commit is contained in:
@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user