aetherscale

[unmaintained] code for a cloud provider tutorial
Log | Files | Refs | README | LICENSE

commit 37703ed7c3ee147fafa603620e5450c7a7028f64
parent 98858f2bc23473c1fdcd9599084b49f45a6e90c8
Author: Stefan Koch <programming@stefan-koch.name>
Date:   Sat, 28 Nov 2020 22:03:52 +0100

show error message on client of broker is not running

Diffstat:
Maetherscale/client.py | 14+++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/aetherscale/client.py b/aetherscale/client.py @@ -99,10 +99,10 @@ def main(): print('Command does not exist', file=sys.stderr) sys.exit(1) - with ServerCommunication() as c: - result = c.send_msg(data, response_expected) - print(result) - - -if __name__ == '__main__': - main() + try: + with ServerCommunication() as c: + result = c.send_msg(data, response_expected) + print(result) + except pika.exceptions.AMQPConnectionError: + print('Could not connect to AMQP broker. Is it running?', + file=sys.stderr)