Improved exception handling in client