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

Merge various CouldntFindX errors into one #4633

Open
Nutomic opened this issue Apr 16, 2024 · 0 comments
Open

Merge various CouldntFindX errors into one #4633

Nutomic opened this issue Apr 16, 2024 · 0 comments
Labels
area: api enhancement New feature or request
Milestone

Comments

@Nutomic
Copy link
Member

Nutomic commented Apr 16, 2024

We have all sorts of separate error messages for NotFound, such as these:

  CouldntFindCommunity,
  CouldntFindPerson,
  CouldntFindComment,
  CouldntFindCommentReport,
  CouldntFindPostReport,
  CouldntFindPrivateMessageReport,
  CouldntFindLocalUser,
  CouldntFindPersonMention,
  CouldntFindRegistrationApplication,
  CouldntFindCommentReply,
  CouldntFindPrivateMessage,
  CouldntFindActivity,

I dont think there is any reason for them, it would be enough to have a single NotFound error. Particularly after #4617 which requires using these errors in a lot more places. That could be simplified by adding a method Option::to_err() which turns it into NotFound error, similar to the way LemmyErrorExt works.

@Nutomic Nutomic added enhancement New feature or request area: api labels Apr 16, 2024
@Nutomic Nutomic mentioned this issue Apr 16, 2024
4 tasks
@Nutomic Nutomic added this to the 0.20.0 milestone May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: api enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant