[错误处理] 从返回的数据库错误中,解析数据冲突的字段
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- mongodb, typescript
Research direction
Start in user/user.controller.ts by reviewing createUser, updateUser, and upsertUserByEmployeeId, then inspect the new upserByUsername/email/phone functions and their TODO. Read mongo/mongo.interceptor.ts to understand where MongoDB errors are intercepted. Done means extracting the conflicting field from the returned database error and removing the repeated handling logic.
Written by the indexing model from the issue text.
Description
需要重构的地方
user/user.controller.ts 中
查看这几个方法,会发现有大量的重复代码
- createUser
- updateUser
- upsertUserByEmployeeId
在新启用的 upserByUsername/email/phone 函数中,加了一个注解
// TODO: 从返回的数据库错误中,解析数据冲突的字段
我们本次需要实现这个
开发建议
- 在 mongo/mongo.interceptor.ts 中已经拦截 mongodb 的错误,在这里进一步处理错误
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Similar issues
-
clawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
ZCode 3.14.3 に対応する Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
supermomonga/zcode-acp#24 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
growthbook/growthbook#7100 ·
-
triage
Difficulty 1/5 1-3 hours Newbie friendliness 88/100