Skip to content

根据优化建议修改 #6

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

Merged
merged 15 commits into from
Jul 19, 2022
Merged

根据优化建议修改 #6

merged 15 commits into from
Jul 19, 2022

Conversation

lianup
Copy link
Contributor

@lianup lianup commented Jul 15, 2022

No description provided.

@lianup lianup linked an issue Jul 15, 2022 that may be closed by this pull request
Copy link
Contributor

@xy-peng xy-peng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我不建议在方法声明加上对应的 exception:

  1. 所有的接口上都加上,跟没加一样
  2. RuntimeExcpetion 是不用加的
  3. 本来我们是希望开发者按需处理的
  4. 函数文档中有列出 throw 的

我们通过提供文档更“明显”让开发者知道会抛出异常,说明为什么我们使用 unchecked exception,结合常见的框架把最佳实践教给开发者的方式,让开发者做好错误处理?

@EmmetZC @Eric-Lee-Handyman 一起讨论下。

如果一定要列,我觉得根据继承关系,只列一个 WechatPayException ?

@xy-peng xy-peng merged commit b016518 into wechatpay-apiv3:main Jul 19, 2022
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

Successfully merging this pull request may close these issues.

关于SDK优化的几个建议
2 participants