Skip to content

Commit 1d08b38

Browse files
committed
Fix output of CLI in case the fingerprint does not match
1 parent 2046134 commit 1d08b38

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

threema-gateway

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import binascii
77
import functools
88
import asyncio
99

10+
import aiohttp
1011
import click
1112

1213
from threema.gateway import __version__ as _version
@@ -399,6 +400,14 @@ def credits(ctx, **arguments):
399400
if __name__ == '__main__':
400401
try:
401402
cli()
403+
except aiohttp.FingerprintMismatch as exc:
404+
error = 'Fingerprints did not match!'
402405
except Exception as exc:
406+
error = str(exc)
407+
else:
408+
error = None
409+
410+
# Print error (if any)
411+
if error is not None:
403412
click.echo('An error occurred:', err=True)
404-
click.echo(exc, err=True)
413+
click.echo(error, err=True)

0 commit comments

Comments
 (0)