Hyperlinkv0.8.0-beta.28

Store

Store.catchWriteErrorsconstsrc/Store.ts:1357
<Effects extends StoreEffectsVariance<StoreContractValue>>(
  effects: Effects
): CatchWriteError<Effects>

Narrow StoreWriteError out of the error channel of a effects object's write methods — a fire-and-forget append that fails a journal/IO write is logged and swallowed (succeeds as void). One-liner over mapEffects. Composes with pipe: pipe(Store.effects(scope, contract), Store.catchWriteErrors).

Scope of the guard, precisely:

  • Write failures are swallowed — the StoreWriteError is caught, logged, and the effect completes successfully; StoreWriteError is removed from E (see CatchWriteError).
  • Defects are NOT swallowed — an encode/serialization mismatch (a bug: the value does not fit the declared shape, dies in the append path) and a wiring die (no store in context) are defects, not failures, so they propagate untouched.
  • Reads and every other error are left exactly as-isExclude<E, StoreWriteError> is a no-op where StoreWriteError is absent.
combinatorsStoreWriteErroreffectsmapEffectsCatchWriteError
Source src/Store.ts:13573 lines
export const catchWriteErrors = <Effects extends StoreEffectsVariance<StoreContractValue>>(
  effects: Effects,
): CatchWriteError<Effects> => mapEffects<Effects, CatchWriteError<Effects>>(effects, swallowWrite);