Improve error handling

This commit is contained in:
Corder Guy 2018-04-17 14:35:29 -05:00
parent 9f2cc875f9
commit db1b48ee02

View file

@ -106,10 +106,6 @@ def fetch_user(user_id):
def fetch_top_n(n):
output = get_top_N('score', True, n)
if output == '[]':
output = None
return output
@ -126,12 +122,13 @@ def process_request(uri):
output = None
if len(parts) < 2:
return None
if parts[1] == 'users':
output = None
elif parts[1] == 'users':
output = fetch_user(parts[2])
elif parts[1] == 'top':
output = fetch_top_n(parts[2])
else:
output = None
return output