During index builds, we use a whilelist to determine whether an error was a key generation error or not.
This whitelist was originally created for oplog application on secondaries since we apply operations out of order, but can only safely ignore specific errors. With two-phase index builds, we now ignore key generation errors on all nodes for later constraint checking.
Two-phase index builds also depend heavily on this whitelist being correct since an unanticipated error can cause a crash.
If we assume all non-interrupt/shutdown exceptions are key generation errors, then we can remove this fragile enumeration of safe errors and be confident no exceptions can be thrown during index builds.