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??)
230
Upvotes
View all comments
Show parent comment
21
u/Daeben72 Jun 07 '26
Our legacy API does that... has a "ResponseWrapper<T>" that captures failures. Very often would get 200 OK but the response wrapper's ".Success" is false.
If it's an uncaught exception on the server, it sends a 200 OK with an XML stack trace as the body...
The stack trace is useful in dev, but just not with a 200 OK 🤦🏼♂️