summaryrefslogtreecommitdiffstats
path: root/utils/test/testapi/opnfv_testapi/resources/result_handlers.py
diff options
context:
space:
mode:
authorSerena Feng <feng.xiaowei@zte.com.cn>2017-03-31 01:42:44 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-03-31 01:42:44 +0000
commit8eb68cff96445dc53ee1c232b565aa4a61d0a526 (patch)
tree18706484d2ae582399724306ce65f5594b7363f7 /utils/test/testapi/opnfv_testapi/resources/result_handlers.py
parent85eba2eafa62f00eb3c28bb9968e89bcaba5e73e (diff)
parentb9e0948256af817e63f901ec5277d3ef9fe36fdd (diff)
Merge "unify raise exception process"
Diffstat (limited to 'utils/test/testapi/opnfv_testapi/resources/result_handlers.py')
-rw-r--r--utils/test/testapi/opnfv_testapi/resources/result_handlers.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/utils/test/testapi/opnfv_testapi/resources/result_handlers.py b/utils/test/testapi/opnfv_testapi/resources/result_handlers.py
index 44b9f8c07..3e78057ce 100644
--- a/utils/test/testapi/opnfv_testapi/resources/result_handlers.py
+++ b/utils/test/testapi/opnfv_testapi/resources/result_handlers.py
@@ -11,8 +11,8 @@ from datetime import timedelta
import httplib
from bson import objectid
-from tornado import web
+from opnfv_testapi.common import raises
from opnfv_testapi.resources import handlers
from opnfv_testapi.resources import result_models
from opnfv_testapi.tornado_swagger import swagger
@@ -30,8 +30,7 @@ class GenericResultHandler(handlers.GenericApiHandler):
try:
value = int(value)
except:
- raise web.HTTPError(httplib.BAD_REQUEST,
- '{} must be int'.format(key))
+ raises.BadRequest('{} must be int'.format(key))
return value
def set_query(self):