Better error handling in robot arm