3 ms·
Your first example loses the real reason for the error and just assumes "record-not-found", so it will give misleading errors when the network drops for a momen
by kstenerud 7y ago
Your first example loses the real reason for the error and just assumes "record-not-found", so it will give misleading errors when the network drops for a moment, possibly resulting in an attempt to insert a duplicate record if the code tries to add-if-not-found. That'll make for some debugging fun!
And this is the problem with error checks: They're purely optional as far as the language is concerned, so we keep getting them wrong or forgetting things, even when we're being careful.