CLOUDIFY-1761 fix exception handling