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

Refactor:错误处理优化——定义统一错误处理 #149

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jerry765
Copy link

内容

引入错误类型和处理函数,并改动相关文件

影响范围

  • 所有错误上抛,统一交由专门错误处理函数
  • 原有文件可能发生错误点均引入错误处理函数

附加信息

issue #148

@jerry765 jerry765 changed the title refactor:错误处理优化——定义统一错误处理 Refactor:错误处理优化——定义统一错误处理 Jan 2, 2024
@pany-ang
Copy link
Member

似乎这样代码更冗余了,能在响应拦截器里处理的错误,放到 view 层来捕获,感觉并不友好

@jerry765

This comment was marked as outdated.

@jerry765
Copy link
Author

似乎这样代码更冗余了,能在响应拦截器里处理的错误,放到 view 层来捕获,感觉并不友好

并不是放在view层捕获,而是将view层的错误统一抛出给专门的错误处理文件进行封装,以提供一致体验,让用户不至于看到原生的代码错误

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.

2 participants