Extract warning logic to `Excon.display_warning`