Add error handling in deploy script