In Win32 mode, with the default panic hook set, panicking occurs without explicit notification, and getting panic information becomes hard.
By adding an error dialog on panic in the default panic hook in Win32 mode, when panic!()
occurs, we can access panic information more easily, which helps debugging and user experience. For example, the panic dialog could contain a button to save panic information to a specified file, so the user can report errors more easily.
By adding the dialog in the panic hook than somewhere else, use cases not expecting a panic dialog are possible, since resume_unwind
does not call the panic hook, and the panic hook can be user-replaced.