r/programminghorror • u/Daeben72 • Jun 05 '26
C# SuccessMessage ErrorMessage
ErrorMessage successMessage = new ErrorMessage(ErrorType.ActivityCreateSuccess);
(From an approved PR with 2 reviewers - how do some people sleep at night??)
231
Upvotes
View all comments
Show parent comment
4
u/Sacaldur Jun 05 '26
It is not uncommen to have one enum that represents all possible statuses and/or a class representing a corresponding result value. Sometimes this enum mostly contains error values and is because of that called something with "error", even though there is exactly the one success case (i.e. not only errors).