HACKER
TALK
Home
Bookmarks
Messages
Notifications
Sign In
Comment
想问下各位后端错误处理怎么做比较优雅?
看了一些大厂的接口,不少都是直接 200 返回的,然后带个错误码。业务逻辑上是直接 service 层包装一下直接返回还是直接抛 Exception 的好?
HD Superman
·
2 years ago
Across the Great Wall, we can reach every corner in the world.
可以参考 google 的 api 规范:
API design error
,黑客说的错误处理就是这套实现。
1
Reply
Report
HD Superman
Joined 3 years ago
Across the Great Wall, we can reach every corner in the world.
https://github.com/hdsuperman
Follow
Message
Latest posts
app无法登录,抓包数据。网页版可以登录,求分析求解
分享免费云服务器
急切寻求rust编译问题帮助(archlinux, openssl)
分享免费GPT4站点
【轉貼】ASP.NET Core Developer Roadmap in 2024
南京大学研究中心诚募博士后
求助can't establish SSL connection.