Beispiel #1
0
/**
 * Helper function to print error messages.
 */
int print_error(int rc, const Query& query)
{
    if (DB_FAILED(rc)) {
        dbs_error_info_t info = dbs_get_error_info( rc );
        String query_message = query.get_error_message();

        cerr << "ERROR " << info.name << ": " << info.description << endl;
        if (query_message.size() > 0) {
            cerr << query_message.c_str() << endl;
        }
    }
    return rc;
}