FdbErrorDebugger

Namespace: FoundationDB.Client · class

Exposes the client's error-translation internals (message lookup, exception mapping, error predicates), for test harnesses and diagnostics.

Remarks

This is the error-side companion of FdbTransactionDebugger: a small proxy that lets test code observe internal behavior without requiring an InternalsVisibleTo grant. Conformance suites use it to pin the native client's answers as the oracle that emulator error behavior is held against.

Every member calls into the native client library (fdb_c); no cluster connection is involved, but the library must be deployed, or the call fails with a DllNotFoundException.

Application logic should never take decisions based on these observations: error handling belongs to the retry loop (db.ReadAsync / WriteAsync), never to per-error application code.

Methods

GetErrorMessage

static string GetErrorMessage(FdbError code)

Returns the native client's message for this error code (fdb_get_error), or null if the code is unknown.

MapToException

static Exception MapToException(FdbError code)

Maps an error code to the exception instance the client would throw for it, or null for Success.

TestErrorPredicate

static bool TestErrorPredicate(FdbErrorPredicate predicate, FdbError code)

Evaluates one of the native client's error predicates (fdb_error_predicate) against an error code.