-
Notifications
You must be signed in to change notification settings - Fork 340
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
增加业务校验异常errorCode=403处理 #619 #626
base: master
Are you sure you want to change the base?
Conversation
see #619 |
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## master #626 +/- ##
==========================================
+ Coverage 30.22% 30.43% +0.20%
==========================================
Files 40 41 +1
Lines 3060 3118 +58
==========================================
+ Hits 925 949 +24
- Misses 2069 2096 +27
- Partials 66 73 +7
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不仅仅是有403,可以参考java实现一版(包括注册中心的response状态码校验)
参照java版,实现了注册中心和配置中心相关接口不同业务异常状态的处理逻辑,包括:
同时,注册中心参照Java版实现,增加实例注册前的参数校验,并返回参数校验的异常提示:
|
目前sdk提供的api屏蔽了nacos server返回的业务校验异常提示
比如server开启安全认证后,client账密错误server的响应:
{"resultCode":500,"errorCode":403,"message":"user not found!","success":false}
比如当前用户只授权读权限,client发起写操作请求server的响应:
{"resultCode":500,"errorCode":403,"message":"authorization failed!","success":false}
等等这些错误提示被屏蔽掉对开发人员排查问题来说不太友好。
为此,增加了对errorCode=403业务异常的处理: