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

增强ApiException的message以确保当出现非预期问题能够更直观地发现问题 #94

Open
orange-guo opened this issue Mar 11, 2024 · 0 comments

Comments

@orange-guo
Copy link

orange-guo commented Mar 11, 2024

问题描述

通过SDK访问服务端返回非200的错误后(Bad Request, Internal Server Error ...), SDK会抛出ApiException, 但是构建该异常的message只使用到了用于描述Http Status Code的message, 这会导致打印到日志的的Exception Stack中只有Http Status Code的信息, 而缺少了上层服务的异常信息, 异常消息如下

com.volcengine.ApiException: Bad Request
	at com.volcengine.ApiClient.handleResponse(ApiClient.java:980)
	at com.volcengine.ApiClient.execute(ApiClient.java:895)
	at com.volcengine.filenas.FilenasApi.createMountPointWithHttpInfo(FilenasApi.java:313)
	at com.volcengine.filenas.FilenasApi.createMountPoint(FilenasApi.java:299)

当出现非API契约的问题时, 例如(ResourceLimit, ApiRateLimit ..., 这会加大问题的排查难度)

期望

message需要增加上层服务的异常信息, 这样能够更直观地发现问题

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

1 participant