示例#1
0
文件: BDB.c 项目: danielnorberg/tc
void tc_Error_SetBDB(TCBDB *bdb) {
  log_trace("ENTER");
  int ecode = tcbdbecode(bdb);
  if (ecode == TCENOREC) {
    PyErr_SetString(PyExc_KeyError, tcbdberrmsg(ecode));
  } else {
    tc_Error_SetCodeAndString(ecode, tcbdberrmsg(ecode));
  }
}
示例#2
0
文件: TDB.c 项目: brendano/tc
static void _set_tdb_error(TCTDB *db) {
  log_trace("ENTER");
  int ecode = tctdbecode(db);
  const char *msg = tctdberrmsg(ecode);
  if (ecode == TCENOREC) {
    PyErr_SetString(PyExc_KeyError, msg);
  } else {
    log_debug("TDB error: %s", msg);
    tc_Error_SetCodeAndString(ecode, msg);
  }
}