diff --git a/bin/mqtt-rpc-client b/bin/mqtt-rpc-client index b658ee7..07eaeac 100755 --- a/bin/mqtt-rpc-client +++ b/bin/mqtt-rpc-client @@ -3,6 +3,7 @@ import argparse import json +import sys from jsonrpc.exceptions import JSONRPCError from wb_common.mqtt_client import DEFAULT_BROKER_URL, MQTTClient @@ -39,11 +40,16 @@ def main(): print(json.dumps(resp)) except TimeoutError: print("Request timed out") + sys.exit(124) except Exception as e: print("Error: %s" % e) + sys.exit(1) finally: mqtt_client.stop() if __name__ == "__main__": - main() + try: + main() + except KeyboardInterrupt: + sys.exit(0) diff --git a/debian/changelog b/debian/changelog index 47fc41e..bc0e299 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +python-mqttrpc (1.2.4) stable; urgency=medium + + * mqtt-rpc-client: fix error handling + + -- Nikolay Korotkiy Mon, 29 Jan 2024 16:15:00 +0400 + python-mqttrpc (1.2.3) stable; urgency=medium * mqtt-rpc-client: fix default value of --args option