Improved exception handling in desktop client connection class