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): ...@@ -43,7 +43,7 @@ class Client(Resource):
try: try:
args = request.get_json() args = request.get_json()
except BadRequest: except BadRequest:
return "POSTed body is invalid JSON", 400 abort(400, message="POSTed body is invalid JSON")
errors = self.schema.validate(args) errors = self.schema.validate(args)
if errors: if errors:
...@@ -73,7 +73,7 @@ class ClientList(Resource): ...@@ -73,7 +73,7 @@ class ClientList(Resource):
try: try:
args = request.get_json() args = request.get_json()
except BadRequest: except BadRequest:
return "POSTed body is invalid JSON", 400 abort(400, message="POSTed body is invalid JSON")
errors = self.schema.validate(args) errors = self.schema.validate(args)
if errors: if errors:
......
...@@ -24,7 +24,7 @@ class Notify(AuthResource): ...@@ -24,7 +24,7 @@ class Notify(AuthResource):
try: try:
args = request.get_json() args = request.get_json()
except BadRequest: except BadRequest:
return "POSTed body is invalid JSON", 400 abort(400, message="POSTed body is invalid JSON")
errors = self.schema.validate(args) errors = self.schema.validate(args)
if errors: if errors:
......
...@@ -25,7 +25,7 @@ class Send(AuthResource): ...@@ -25,7 +25,7 @@ class Send(AuthResource):
try: try:
args = request.get_json() args = request.get_json()
except BadRequest: except BadRequest:
return "POSTed body is invalid JSON", 400 abort(400, message="POSTed body is invalid JSON")
errors = self.schema.validate(args) errors = self.schema.validate(args)
if errors: 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