Rescue the specific exception when the shell command fails.