CLOUD-229 fixed error handling