get_index_range() should return a tuple; return HTTP status code from RPC

This commit is contained in:
Jude Nelson
2018-09-17 18:32:51 -04:00
parent ac4ad9dba1
commit 917af62716

View File

@@ -188,6 +188,8 @@ def get_index_range(working_dir):
else:
return first_block, last_block - NUM_CONFIRMATIONS
return None, None
def rpc_traceback():
exception_data = traceback.format_exc().splitlines()
@@ -899,10 +901,10 @@ class BlockstackdRPC(BoundedThreadingMixIn, SimpleXMLRPCServer):
Return {'error': ...} on error
"""
if not check_name(name):
return {'error': 'invalid name'}
return {'error': 'invalid name', 'http_status': 400}
if not check_count(page):
return {'error': 'invalid page'}
return {'error': 'invalid page', 'http_status': 400}
page_size = 20
offset = page * page_size