Delegate event code used for error handling.