Update deployment status to failure on code errors

I'm getting a weird encoding error intermittently when kicking off deployments. This ensures that we set a status to failure if the code blows up for any reason.