Handling errors the smart way
Setting RaiseError make the DBI call die for you
For simple applications immediate death on error is fine
- The error message is usually accurate and detailed enough
- Better than the error messages some developers use!
-
For more advanced applications greater control is needed, perhaps:
- Correct the problem and retry
- or, Fail that chunk of work and move on to another
- or, Log error and clean up before a graceful exit
- or, whatever else to need to do
-
Buzzwords:
- Need to catch the error exception being thrown by RaiseError
-