Skip to content

Commit

Permalink
Fix error handling (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
sikmir authored Jan 30, 2024
1 parent ab40b9e commit 8350a8e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/mqtt-rpc-client
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
python-mqttrpc (1.2.4) stable; urgency=medium

* mqtt-rpc-client: fix error handling

-- Nikolay Korotkiy <nikolay.korotkiy@wirenboard.com> 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
Expand Down

0 comments on commit 8350a8e

Please sign in to comment.