void Retsu::Records::insert(const RecordID& key) { double new_value = tcfdbadddouble(database, key, FDBIDNEXT); if(isnan(new_value)) { throw StorageError("Could not insert into records database key => " + boost::lexical_cast<string>(key) + ". " + tcfdberrmsg(tcfdbecode(database))); } }
PyObject * set_fdb_error(TCFDB *fdb, long long key) { int ecode; ecode = tcfdbecode(fdb); if (key && ((ecode == TCENOREC) || (ecode == TCEKEEP))) { return PyErr_Format(PyExc_KeyError, "%ld", (long)key); } return set_error(Error, tcfdberrmsg(ecode)); }
/* print error information */ static void printerr(TCFDB *fdb){ const char *path = tcfdbpath(fdb); int ecode = tcfdbecode(fdb); fprintf(stderr, "%s: %s: %d: %s\n", g_progname, path ? path : "-", ecode, tcfdberrmsg(ecode)); }
/* print error message of fixed-length database */ static void eprint(TCFDB *fdb, int line, const char *func){ const char *path = tcfdbpath(fdb); int ecode = tcfdbecode(fdb); fprintf(stderr, "%s: %s: %d: %s: error: %d: %s\n", g_progname, path ? path : "-", line, func, ecode, tcfdberrmsg(ecode)); }