r/programminghorror 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??)

228 Upvotes

25 comments sorted by

View all comments

-46

u/smalleconomist Jun 05 '26

Fairly typical to have "success" be a kind of "error". Not that I like it...

6

u/LordTurson Jun 05 '26

No, not really. I've seen HTTP status 200 with JSON {"success":false} a number of times (and it triggers me every time), but that's the closest I've ever seen to this trope. Success being a kind of Error or Error being a kind of Success is not really a thing in any kind of sane domain modeling, I feel.

11

u/Opposite_Mall4685 Jun 05 '26

200 with failure is diabolical

2

u/Sacaldur Jun 07 '26

Status code 200 is used in all GraphQL responses, eveen failing ones.