Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

调用/open-apis/v1/messages时频现 Request failed with status code 400,且无调用相关log #118

Open
drinkmooon opened this issue Jan 13, 2025 · 2 comments

Comments

@drinkmooon
Copy link

调用/open-apis/v1/messages以及/open-apis/user/v1/batch_get_id这两个API时,频繁出现Request failed with status code 400。且报错内容中,无response-header的信息,无法获取logid。

sdk封装了获取tenant_access_token的过程,为什么还会报400;该怎么把SDK内部的错误打印出来,该怎么获取请求失败时的logid

@drinkmooon
Copy link
Author

image
初始化Lark Client如上,调用方式如下
image
此处日志中取的ctx.response.header.logid是这个RPC请求的,不是HTTP请求的。

@mazhe-nerd
Copy link
Collaborator

可以用一个最小demo复现一下不?上面代码看起来是和框架&业务逻辑在一起,不好定位;

需要取到错误的话,可以try cacth一下,调用失败会把错误throw 出来:

try {
 await client.request()
} catch(e) {
 console.log(e)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants