Merge pull request #6152 from JeremyRand/rpc-error-exit-code

RPC client: exit code 1 if RPC server returned error
This commit is contained in:
ThomasV 2020-05-10 12:01:33 +02:00 committed by GitHub
commit 1322fa6a08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -433,6 +433,7 @@ if __name__ == '__main__':
print_msg(result) print_msg(result)
elif type(result) is dict and result.get('error'): elif type(result) is dict and result.get('error'):
print_stderr(result.get('error')) print_stderr(result.get('error'))
sys_exit(1)
elif result is not None: elif result is not None:
print_msg(json_encode(result)) print_msg(json_encode(result))
sys_exit(0) sys_exit(0)