3 ms·
Quietly returning something sensible is also a way to end up with weird bugs, except they are harder to find because it leaves open the possibility that the cal
by ryandrake 5y ago
Quietly returning something sensible is also a way to end up with weird bugs, except they are harder to find because it leaves open the possibility that the caller fails to check the return value for this token, and the program keeps humming along. At least log loudly so an attentive developer has a chance of finding the bug. I guess this is now an an old-school practice, but I've always been a believer in throwing an exception on error so that they are totally obvious and you don't ship with them. Crash early, crash often. Find the bug before it hits production.
- marcus_holmes 5y agoyeah, always use a static analysis tool to check for unchecked error values. Saved my arse so many times!