Skip to content

Commit

Permalink
fix: fix debug paramters (#1652)
Browse files Browse the repository at this point in the history
  • Loading branch information
baurine committed Aug 30, 2024
1 parent 6cfa4e5 commit 9d2b0ce
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ui/packages/tidb-dashboard-for-op/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ PUBLIC_URL='/dashboard'
REACT_APP_VERSION=$npm_package_version
REACT_APP_MIXPANEL_HOST=https://telemetry.pingcap.com/api/v1/dashboard/report
REACT_APP_MIXPANEL_TOKEN=
REACT_APP_DASHBOARD_API_URL=http://127.0.0.1:2379
REACT_APP_DASHBOARD_API_URL=http://127.0.0.1:12333
11 changes: 9 additions & 2 deletions util/rest/error_resp.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"strings"

"github.com/joomcode/errorx"
"github.com/pingcap/log"
"go.uber.org/zap/zapcore"
)

type ErrorResponse struct {
Expand Down Expand Up @@ -94,11 +96,16 @@ func buildDetailMessage(err error) string {
}

func NewErrorResponse(err error) ErrorResponse {
logLevel := log.GetLevel()
fullText := ""
if logLevel == zapcore.DebugLevel {
fullText = buildDetailMessage(err)
}
return ErrorResponse{
Error: true,
Message: buildSimpleMessage(err),
Code: removeErrorPrefix(buildCode(err)),
// For security reasons, we need to hide detailed stacktrace info.
// FullText: buildDetailMessage(err),
// For security reasons, we need to hide detailed stacktrace info in prod.
FullText: fullText,
}
}

0 comments on commit 9d2b0ce

Please sign in to comment.