summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2015-06-21 14:03:20 +0100
committerJohannes Löthberg <johannes@kyriasis.com>2015-06-21 14:03:20 +0100
commit1769cb84c90c909103315e72d4a9fba8043bacc5 (patch)
treec97778106d974fba0ba42f6e190011330015ba2c
parentaae76064886b73f5097b73db75ef0871b1d23a0f (diff)
downloadfingerchange-1769cb84c90c909103315e72d4a9fba8043bacc5.tar.xz
Print diagnostic on empty resultsHEADmaster
-rwxr-xr-xsrc/fingerchange.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/fingerchange.py b/src/fingerchange.py
index 65a2691..9e3cc97 100755
--- a/src/fingerchange.py
+++ b/src/fingerchange.py
@@ -137,6 +137,12 @@ def handle_client(reader, writer):
except ValueError:
users = get_users_by_name(site, user)
+ if len(users) == 0:
+ error = 'finger: no user found by id or name \'{}\'\n'.format(user)
+ writer.write(error.encode('utf-8'))
+ writer.close()
+ return
+
for user in users:
if user['user_type'] == 'unregistered':
continue