From b9e0948256af817e63f901ec5277d3ef9fe36fdd Mon Sep 17 00:00:00 2001 From: SerenaFeng Date: Thu, 30 Mar 2017 15:33:19 +0800 Subject: unify raise exception process Change-Id: I109ef9550a57e218b6f5c9196812b33133d34134 Signed-off-by: SerenaFeng --- utils/test/testapi/opnfv_testapi/resources/result_handlers.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'utils/test/testapi/opnfv_testapi/resources/result_handlers.py') 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): -- cgit 1.2.3-korg