Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feat/cleaning_ops_trace' into fe…
Browse files Browse the repository at this point in the history
…at/cleaning_ops_trace

* origin/feat/cleaning_ops_trace:
  feat: add trace_config_check_error

# Conflicts:
#	api/services/ops_trace/ops_trace_service.py
  • Loading branch information
ZhouhaoJiang committed Jun 21, 2024
2 parents a589edc + 04af80c commit e7caf2f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions api/controllers/console/app/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 4 additions & 2 deletions api/controllers/console/app/ops_trace.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit e7caf2f

Please sign in to comment.