stdarted adding try ..catch to c++ code