Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
错误处理底层使用标准库的 errors.Wrapf,因此我们业务中返回错误都适用于 errors,但是推荐使用我们 perr 定义错误。因为在项目迭代,使用 rpc 后,rpc 的返回的错误我们可以自定义重写,返回给前端错误信息。默认返回错误:服务器开小差了。
目前在 login 模块已经使用了错误码封装。错误处理后,自动日志上报未完成。错误已经可以打印到 console。