diff --git a/api/controllers/console/app/error.py b/api/controllers/console/app/error.py index cd7919b5e426bd..f6feed12217a85 100644 --- a/api/controllers/console/app/error.py +++ b/api/controllers/console/app/error.py @@ -109,3 +109,9 @@ class TracingConfigIsExist(BaseHTTPException): error_code = 'trace_config_is_exist' description = "Trace config is exist." code = 400 + + +class TracingConfigCheckError(BaseHTTPException): + error_code = 'trace_config_check_error' + description = "Invalid Credentials." + code = 400 diff --git a/api/controllers/console/app/ops_trace.py b/api/controllers/console/app/ops_trace.py index 382f1ed89b3c9b..2a0681a9e60c26 100644 --- a/api/controllers/console/app/ops_trace.py +++ b/api/controllers/console/app/ops_trace.py @@ -1,7 +1,7 @@ from flask_restful import Resource, reqparse from controllers.console import api -from controllers.console.app.error import TracingConfigIsExist, TracingConfigNotExist +from controllers.console.app.error import TracingConfigCheckError, TracingConfigIsExist, TracingConfigNotExist from controllers.console.setup import setup_required from controllers.console.wraps import account_initialization_required from libs.login import login_required @@ -49,7 +49,9 @@ def post(self, app_id): ) if not result: raise TracingConfigIsExist() - return {"result": "success"} + if result.get('error'): + raise TracingConfigCheckError() + return result except Exception as e: raise e