Fix error handling during deployments