Fixed typo
This commit is contained in:
@@ -29,6 +29,10 @@ class handler(asyncTornado.asyncRequestHandler):
|
||||
args_filter = asyncTornado.check_arguments(self.request.arguments, ARGS)
|
||||
if False in args_filter:
|
||||
raise Exception("Missing required arguments")
|
||||
|
||||
print()
|
||||
print(args_filter)
|
||||
print()
|
||||
|
||||
method = args_filter[0]
|
||||
method_value = self.request.arguments[method]
|
||||
@@ -44,14 +48,16 @@ class handler(asyncTornado.asyncRequestHandler):
|
||||
cur.execute(sql)
|
||||
data = cur.fetchone()
|
||||
|
||||
cur.close()
|
||||
|
||||
status_code = 200
|
||||
except Exception as e:
|
||||
status_code = 400
|
||||
data["status"] = status_code
|
||||
data["message"] = e
|
||||
finally:
|
||||
cur.close()
|
||||
|
||||
print(data)
|
||||
|
||||
self.write( json.dumps(data) )
|
||||
self.set_header("Content-Type", "application/json")
|
||||
self.set_status(status_code)
|
||||
|
||||
Reference in New Issue
Block a user