[SERVER-69695] ErrorCodes::KeyNotFound and ErrorCodes::NoSuchKey are ambiguous Created: 14/Sep/22 Updated: 14/Aug/23 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Yujin Kang Park | Assignee: | Backlog - Storage Execution Team |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | techdebt | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Storage Execution
|
| Participants: |
| Description |
|
The KeyNotFound and NoSuchKey code names may cause confusion to readers. Apparently, KeyNotFound refers to indexes, while NoSuchKey is used to indicate a field is not found within a BSON object. Making the names more explicit would help readability and make incorrect use less likely. There is at least one location (storage_interface_impl.cpp) where NoSuchKey is used to indicate no documents were found. |
| Comments |
| Comment by Connie Chen [ 14/Aug/23 ] |
|
We should investigate where these errors are used and if we want to change the error codes we return as that would cause backward compatibility issues. |