CLOUD-183 fixed exception handling