Handle shell command failures gracefully.