Add exception handling to cpp examples
Add exception handling to cpp examples

Getting rid of uncaught exception issue pointed out by Coverty scan

Rombur/Cap,dalg24/Cap,dalg24/Cap,Rombur/Cap,Rombur/Cap,ORNL-CEES/Cap,dalg24/Cap,ORNL-CEES/Cap,ORNL-CEES/Cap