MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / AssertfCtx

Function AssertfCtx

base/devmode.go:27–30  ·  view source on GitHub ↗

AssertfCtx logs an error message and continues execution, or when compiled with the `cb_sg_devmode` build tag panics for better dev-time visibility. The SG test harness will ensure AssertionFailCount is zero at the end of tests, even without devmode enabled. Note: Callers MUST ensure code is safe to

(ctx context.Context, format string, args ...any)

Source from the content-addressed store, hash-verified

25// The SG test harness will ensure AssertionFailCount is zero at the end of tests, even without devmode enabled.
26// Note: Callers MUST ensure code is safe to continue executing after the Assert (e.g. by returning an error) and MUST NOT be used like a panic that will halt.
27func AssertfCtx(ctx context.Context, format string, args ...any) {
28 SyncGatewayStats.GlobalStats.ResourceUtilization.AssertionFailCount.Add(1)
29 assertLogFn(ctx, AssertionFailedPrefix+format, args...)
30}

Callers 15

ctxMethod · 0.92
shouldCheckAdminRBACMethod · 0.92
handlePutDocMethod · 0.92
handleDeleteDocMethod · 0.92
handleAllDocsMethod · 0.92
InitializeIndexesFunction · 0.92
ChangeVersionStringMethod · 0.92
createChangesEntryFunction · 0.92
updateAndReturnDocMethod · 0.92

Calls 1

AddMethod · 0.45

Tested by

no test coverage detected