lemmy
lemmy copied to clipboard
Merge various `CouldntFindX` errors into one
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 https://github.com/LemmyNet/lemmy/pull/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.