You can Ctrl+Alt+Delete,
Or go into Activity Monitor or your App Processes in Task Manager -> 'Apps' then right click on app to get 'Properties' on what should be something like PuTTY.exe and any of the other Putty programs...ie. Puttygen, etc.
Set it to Manual startup or Disabled and on restart settings caused by errors configure your preferences of whether you want the program to close indefinitely (or until next open, while shutting down the processes associated as well, or if you want it to auto-restart). All those settings are in there. Task manager's one of the easiest ways to get there.
You could also do some sort of scripting similar to that of VPNs where if network has disruptions or anything but success, especially errored responses then close program. Look into open source VPNs on Github in Powershell, C#, PHP, Python. You would have to have it as a process that was triggered on launch or startup of application.