Skip to content

Commit

Permalink
优化访问后端接口出现错误时的错误消息
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-smile committed Aug 9, 2023
1 parent a4fd97c commit b84d073
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/apisix/editions/ee/plugins/bk-components/bklogin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function _M.get_username_by_bk_token(bk_token)

if result.bk_error_code ~= 0 then
return {
error_message = "bk_token is invalid",
error_message = string_format("bk_token is invalid, code: %s", result.bk_error_code),
}
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe(

local result, err = bklogin.get_username_by_bk_token("fake-bk-token")
assert.is_nil(result.username)
assert.is_equal(result.error_message, "bk_token is invalid")
assert.is_equal(result.error_message, "bk_token is invalid, code: 1")
assert.is_nil(err)
end
)
Expand Down

0 comments on commit b84d073

Please sign in to comment.