L
lovecreatesbea...
Is the following code (without any code at lines x and x + 3) correct?
Is it better to call exit() or re-throw the exceptions at line x and
line x + 3?. What is the better code should we place at line x and
line x + 3?
try {
cnn = env->createConnection(user, pwd, db);
} catch (SQLException &esql){
cerr << "DB Exception: " << esql.getMessage();
/* line x ? */
} catch (exception &e){
cerr << "Exception: " << e.what();
/* line x + 3 ? */
}
/*more code*/
Is it better to call exit() or re-throw the exceptions at line x and
line x + 3?. What is the better code should we place at line x and
line x + 3?
try {
cnn = env->createConnection(user, pwd, db);
} catch (SQLException &esql){
cerr << "DB Exception: " << esql.getMessage();
/* line x ? */
} catch (exception &e){
cerr << "Exception: " << e.what();
/* line x + 3 ? */
}
/*more code*/