Improve client exception handling