|
[True tales from the trenches] On Error Resume NextBy Eric Hartwell -- Saturday, March 12, 2005
Function WorksFine(EmployeeID)On Error Resume Next As you might expect, sometimes the Calculate function would fail and return one of its many documented error codes -- such as, for instance, when the LoadEmployeeData call failed and returned one of its many documented error codes. What you might not expect was that sometimes the EmployeeRecord object had enough valid data left over from the previous transaction that the SaveEmployeeData call would actually succeed in trashing some unrelated employee's record, before returning with or without one of its many documented error codes. The other programmer was quite upset when I put error handling into his routine. It turned out he had written it this way deliberately so he didn't need to write an error handler. This was how he achieved the high productivity that made him a "star" programmer. Moral: You get what you reward. |
|
|