Add debug code for event exceptions.