MCPcopy Create free account
hub / github.com/apple/foundationdb / checkError

Method checkError

fdbserver/KeyValueStoreSQLite.actor.cpp:276–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

274 }
275
276 void checkError(const char* context, int rc) {
277 // if (deterministicRandom()->random01() < .001) rc = SQLITE_INTERRUPT;
278 if (rc) {
279 // Our exceptions don't propagate through sqlite, so we don't know for sure if the error that caused this
280 // was an injected fault. Assume that if VFSAsyncFile caught an injected Error that it caused this error
281 // return code.
282 Error err = io_error();
283 if (g_network->isSimulated() && VFSAsyncFile::checkInjectedError()) {
284 err = err.asInjectedFault();
285 }
286
287 if (db)
288 db->errCode = rc;
289 if (rc == SQLITE_NOMEM)
290 platform::outOfMemory(); // SOMEDAY: Trap out of memory errors at allocation time; check out different
291 // allocation options in sqlite
292
293 TraceEvent(SevError, "DiskError")
294 .error(err)
295 .detail("In", context)
296 .detail("File", filename)
297 .detail("SQLiteError", sqlite3ErrStr(rc))
298 .detail("SQLiteErrorCode", rc)
299 .GetLastError();
300 throw err;
301 }
302 }
303
304 void checkpoint(bool restart) {
305 int logSize = 0, checkpointCount = 0;

Callers 15

StatementMethod · 0.45
~StatementMethod · 0.45
StatementClass · 0.45
nextRowMethod · 0.45
IntKeyCursorMethod · 0.45
~IntKeyCursorMethod · 0.45
RawCursorMethod · 0.45
destroyCursorMethod · 0.45
moveFirstMethod · 0.45
moveNextMethod · 0.45
movePreviousMethod · 0.45
sizeMethod · 0.45

Calls 6

outOfMemoryFunction · 0.85
TraceEventClass · 0.85
asInjectedFaultMethod · 0.80
detailMethod · 0.80
isSimulatedMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected