Add special handling for error events