Added generic error handler.