eden/fs/sqlite/Sqlite.cpp
// Given a sqlite result code, if the result was not successful
// (SQLITE_OK), format an error message and throw an exception.
Given a sqlite result code, if the result was not successful
(SQLITE_OK), format an error message and throw an exception.
Given a sqlite result code if the result was not successful ( SQLITE_OK ) format an error message and throw an exception .
void checkSqliteResult(sqlite3* db, int result) {
  if (result == SQLITE_OK) {
    return;
  }
  if (db) {
    throw std::runtime_error(to<string>(
        "sqlite error: ",
        result,
        ": ",
        sqlite3_errstr(result),
        " ",
        sqlite3_errmsg(db)));
  }
  throw std::runtime_error(
      to<string>("sqlite error: ", result, ": ", sqlite3_errstr(result)));
}
void checkSqliteResult ( sqlite3 * db , int result ) { if ( result == SQLITE_OK ) { return ; } if ( db ) { throw std :: runtime_error ( to < string > ( " " , result , " " , sqlite3_errstr ( result ) , " " , sqlite3_errmsg ( db ) ) ) ; } throw std :: runtime_error ( to < string > ( " " , result , " " , sqlite3_errstr ( result ) ) ) ; }
Given a sqlite result code, if the result was not successful
(SQLITE_OK), format an error message and throw an exception.
Given a sqlite result code if the result was not successful ( SQLITE_OK ) format an error message and throw an exception .
// Sometimes the db instance holds more useful context // otherwise resort to a simpler number->string mapping