Add diagnostics for unexpected failures.