From a320153d3ee820434fc390029328b853e3434fc6 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Fri, 17 Jul 2015 20:20:10 +0300 Subject: bugfix --- track_online.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'track_online.py') diff --git a/track_online.py b/track_online.py index c1bae37..7a4085d 100644 --- a/track_online.py +++ b/track_online.py @@ -4,12 +4,18 @@ from datetime import datetime import time +import sys import api def users_get(user_ids): - return api.users_get(user_ids=','.join(user_ids), - fields='online,last_seen') + response = api.users_get(user_ids=','.join(user_ids), + fields='online,last_seen') + if len(response) < len(user_ids): + print('Error: couldn\'t find at least one of the users!', + file=sys.stderr) + sys.exit(1) + return response def log(s): print('[{}] {}'.format(datetime.now().replace(microsecond=0), s)) -- cgit v1.2.3