Just a quick update... I realised that I am able to catch an exception due to software error. For example, there is a mis-match between data size.
However, my objective is to catch errors due to network disconnection, or the other nodes hang abruptly. In this case, I read that there is no way because mpiexec does not trap the errors and will proceed to terminate all running processes.
Please read clause 5 of the Reference Manual about fault tolerance - might be this is your case (or might be you are talking about check-points). Mpiexec does not catch errors! Mpiexec aborts an application if one of the processes has been aborted because of error.