int f2(); // error handling of f2() is along the lines of f1() int f3(); // error handling of f3() is along the lines of f1() int f1() { int ret = 0; try { if(f2() == ERROR) { // throw 1; } if(f3() == ERROR) { // throw 1; } } catch(const int& err) { ret = err; } return ret; }