Commit 0a48aa56 authored by James Kirk's avatar James Kirk
Browse files

refactor: returns into aborts

2 merge requests!23Resolve "Release v0.1.0",!17fix: correct error code resp
Pipeline #108973 passed with stages
in 1 minute and 40 seconds
......@@ -43,7 +43,7 @@ class Client(Resource):
try:
args = request.get_json()
except BadRequest:
return "POSTed body is invalid JSON", 400
abort(400, message="POSTed body is invalid JSON")
errors = self.schema.validate(args)
if errors:
......@@ -73,7 +73,7 @@ class ClientList(Resource):
try:
args = request.get_json()
except BadRequest:
return "POSTed body is invalid JSON", 400
abort(400, message="POSTed body is invalid JSON")
errors = self.schema.validate(args)
if errors:
......
......@@ -24,7 +24,7 @@ class Notify(AuthResource):
try:
args = request.get_json()
except BadRequest:
return "POSTed body is invalid JSON", 400
abort(400, message="POSTed body is invalid JSON")
errors = self.schema.validate(args)
if errors:
......
......@@ -25,7 +25,7 @@ class Send(AuthResource):
try:
args = request.get_json()
except BadRequest:
return "POSTed body is invalid JSON", 400
abort(400, message="POSTed body is invalid JSON")
errors = self.schema.validate(args)
if errors:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment