MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / save_err_msg

Function save_err_msg

modules/dasSQLITE/sqlite/shell.c:18010–18031  ·  view source on GitHub ↗

** Allocate space and save off string indicating current error. */

Source from the content-addressed store, hash-verified

18008** Allocate space and save off string indicating current error.
18009*/
18010static char *save_err_msg(
18011 sqlite3 *db, /* Database to query */
18012 const char *zPhase, /* When the error occcurs */
18013 int rc, /* Error code returned from API */
18014 const char *zSql /* SQL string, or NULL */
18015){
18016 char *zErr;
18017 char *zContext;
18018 sqlite3_str *pStr = sqlite3_str_new(0);
18019 sqlite3_str_appendf(pStr, "%s, %s", zPhase, sqlite3_errmsg(db));
18020 if( rc>1 ){
18021 sqlite3_str_appendf(pStr, " (%d)", rc);
18022 }
18023 zContext = shell_error_context(zSql, db);
18024 if( zContext ){
18025 sqlite3_str_appendall(pStr, zContext);
18026 sqlite3_free(zContext);
18027 }
18028 zErr = sqlite3_str_finish(pStr);
18029 shell_check_oom(zErr);
18030 return zErr;
18031}
18032
18033#ifdef __linux__
18034/*

Callers 1

shell_execFunction · 0.85

Calls 2

shell_error_contextFunction · 0.85
shell_check_oomFunction · 0.85

Tested by

no test coverage detected