Move chained shell command to separate begin/rescue blocks