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

服务不存在时,多个错误只返回第一个 #114

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

reallovelei
Copy link
Contributor

Please provide issue(s) of this PR:
Fixes #94

To help us figure out who should review this PR, please put an X in all the areas that this PR affects.

  • Configuration
  • Docs
  • Performance and Scalability
  • Naming
  • HealthCheck
  • Test and Release

Please check any characteristics that apply to this pull request.

  • Does not have any user-facing changes. This may include API changes, behavior changes, performance improvements, etc.

@reallovelei
Copy link
Contributor Author

@andrewshan look at this pr, OK?

return model.NewSDKError(model.ErrCodeServerUserError, rawErr,
fmt.Sprintf("multierrs received for GetInstances request, serviceKey: %s", *dstService))
// 只要有一个错误就立刻返回,避免所以错误都抛出来干扰 开发者的判断。
for key, sdkErr := range sdkErrs {
Copy link
Member

Choose a reason for hiding this comment

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

建议这样,全部的错误信息还是要打印到日志上,方便定位,然后只返回第一个错误

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.

服务不存在时,不抛错误,只返回空实例列表
3 participants