4 ms·
When you've got 80,000 engineers you end up with lots of different opinions on what the wire protocol should look like. * Sometimes, you want to fail closed -
by jpollock 2y ago
When you've got 80,000 engineers you end up with lots of different opinions on what the wire protocol should look like.
* Sometimes, you want to fail closed - errors are returned for all errors.
* Sometimes, you want to fail open - ok is returned for errors.
* Sometimes, you want to separate "failure" from "denied", the code "worked", but it didn't do what the client wanted - think "payment declined", so you return "OK", with the actual result in the response.
Compare the different costs to charge a credit card that is expired vs one that works.
* The expired one can be checked before calling out to the processor - cheap, returns "OK + Declined".
* The success ends up with a call to the processor and takes a second or two, returns "OK + Success".