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

polaris-java对外接口抛异常的行为优化 #167

Open
andrewshan opened this issue Jul 6, 2022 · 0 comments
Open

polaris-java对外接口抛异常的行为优化 #167

andrewshan opened this issue Jul 6, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@andrewshan
Copy link
Member

北极星当前接口抛出来的异常是RumtimeException,用户程序如果不进行catch的话,会导致接口失败。传递到上层线程就会失败。
因此,接口行为建议修改如下:

  1. 不是所有错误码都跑异常,只有出现SDK内部错误的情况,SDK出现没法运行的情况,才抛异常。
  2. reponse增加一个Code字段,给出对应的返回码

需要抛异常的情况:

  • 插件初始化失败:PLUGIN_ERROR
  • 配置错误,SDK初始化失败:INVALID_CONFIG
  • SDK已经销毁,状态错误:INVALID_STATE
@andrewshan andrewshan added the enhancement New feature or request label Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant