aboutsummaryrefslogtreecommitdiff
path: root/app/handlers/base.py
diff options
context:
space:
mode:
authorMilo Casagrande <milo.casagrande@linaro.org>2014-11-12 17:35:34 +0100
committerMilo Casagrande <milo.casagrande@linaro.org>2014-11-12 17:35:34 +0100
commitfa9c001a2b88a9c7ee43015528c4e938cb46c0db (patch)
treee1a10cd8173a06d124bd57e66d3412763e0010b2 /app/handlers/base.py
parenta6d2a1d4df3c2544fa0425dc492b11fcca1c70ef (diff)
Add /lab URL handler.
Change-Id: I89a770993556b1c1795108e200a0e2bfb956c761
Diffstat (limited to 'app/handlers/base.py')
-rw-r--r--app/handlers/base.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/app/handlers/base.py b/app/handlers/base.py
index 4fdde92..d8271a7 100644
--- a/app/handlers/base.py
+++ b/app/handlers/base.py
@@ -1,5 +1,3 @@
-# Copyright (C) 2014 Linaro Ltd.
-#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
@@ -29,7 +27,7 @@ import models
import utils
import utils.db
import utils.log
-import utils.validator as utilsv
+import utils.validator as validator
STATUS_MESSAGES = {
@@ -190,7 +188,7 @@ class BaseHandler(tornado.web.RequestHandler):
try:
json_obj = json.loads(self.request.body.decode('utf8'))
- valid_json, j_reason = utilsv.is_valid_json(
+ valid_json, j_reason = validator.is_valid_json(
json_obj, self._valid_keys("POST")
)
if valid_json:
@@ -207,7 +205,8 @@ class BaseHandler(tornado.web.RequestHandler):
else:
response.reason = "Provided JSON is not valid"
response.result = None
- except ValueError:
+ except ValueError, ex:
+ self.log.exception(ex)
error = "No JSON data found in the POST request"
self.log.error(error)
response = handr.HandlerResponse(422)