Add a simple error handler for MySQL calls