News for hackers. Stuff that matters.
Re:You’re better off using Exceptions by kstenerud on Monday February 03, 2020 @03:14PM (#22228477)
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.

There are no comments on this comment yet.