Skip to content

Function: reportRelationCacheError()

ts
function reportRelationCacheError(
  model: LucidModel,
  error: E_RELATION_CACHE_OPERATION_FAILED,
): void;

Reports a runtime relation-cache failure to the effective handler (ADR-009).

Resolves the handler by precedence — the model's own $resourcefulOnRelationsCacheError → the process-wide default → no-op — then invokes it SYNCHRONOUSLY inside a guard (a throwing handler is swallowed) and does NOT await it (a returned promise is fire-and-forget), so a slow or failing reporter can neither delay nor break the load. When no handler resolves the failure is dropped (the package never logs on its own). The CALLER performs the actual fallback (DB load / skip caching / continue the write); this function only observes.

Parameters

ParameterTypeDescription
modelLucidModelThe model whose handler should be consulted.
errorE_RELATION_CACHE_OPERATION_FAILEDThe typed relation-cache operational failure to report.

Returns

void