When output goes to a specified buffer (instead of current buffer) it is possible to check the return value from shell-command. I suggest doing that in org-latex.diff, see attached file. I think the doc string of shell-command should be updated too since it does not mention that you can test the return value in this case.