Only capture file when command fails