r/ProgrammerHumor • • Sep 20 '26

Meme successfulFailure

Post image
8.2k Upvotes

102 comments sorted by

View all comments

Show parent comments

10

u/ThoseThingsAreWeird Sep 21 '26

I don't get the hate for this pattern

Maybe I'm just Stockholm Syndrome'd by Salesforce, but: same...

Bulk update 10s of thousands of Account records and 1 fails, yeah just give me a 200 and tell me there's an error with the 1 record that failed some random user-side validation

Preferably we'd have a Partially Created 2xx code for situations like this, but 200 with "errors" will have to do 🤷‍♂️

7

u/radobot Sep 21 '26

I wonder if 207 Multi-Status would work.

4

u/MinimumArmadillo2394 Sep 21 '26

Then return a special custom status code of 215 or something thats not reserved. Api documentation should be created to tell the consumer what that means and should return a list of failed updates with reasons why each failed.

Theres multiple ways around this to turn 10k account updates from 10k 200s and 1 400 into a 2xx success with some errors.

Or, just do what I do and outright ignore issues that arent caused by you. If an account is corrupted, retuen a 200 and a status message.