Add error message for offset/limit type errors
This commit is contained in:
parent
9ca9bfe46f
commit
2cd4fcfd88
@ -62,9 +62,8 @@ def v0_api(api):
|
|||||||
try:
|
try:
|
||||||
limit = int(request.args.get("limit", "20"))
|
limit = int(request.args.get("limit", "20"))
|
||||||
offset = int(request.args.get("offset", "0"))
|
offset = int(request.args.get("offset", "0"))
|
||||||
except ValueError:
|
except ValueError as e:
|
||||||
# TODO return an error
|
return jsonify(error={"msg":str(e)}), 400
|
||||||
pass
|
|
||||||
|
|
||||||
with api.config["GITLOCK"].lock:
|
with api.config["GITLOCK"].lock:
|
||||||
recipes = map(lambda f: f[:-5], list_branch_files(api.config["GITLOCK"].repo, "master"))
|
recipes = map(lambda f: f[:-5], list_branch_files(api.config["GITLOCK"].repo, "master"))
|
||||||
@ -127,9 +126,8 @@ def v0_api(api):
|
|||||||
try:
|
try:
|
||||||
limit = int(request.args.get("limit", "20"))
|
limit = int(request.args.get("limit", "20"))
|
||||||
offset = int(request.args.get("offset", "0"))
|
offset = int(request.args.get("offset", "0"))
|
||||||
except ValueError:
|
except ValueError as e:
|
||||||
# TODO return an error
|
return jsonify(error={"msg":str(e)}), 400
|
||||||
pass
|
|
||||||
|
|
||||||
recipes = []
|
recipes = []
|
||||||
errors = []
|
errors = []
|
||||||
|
Loading…
Reference in New Issue
Block a user