Skip to content

tapError

tapError<E, A>(f): (data) => Result<E, A>

Defined in: Core/Result.ts:186

Executes a side effect on the error value without changing the Result. Useful for logging or reporting errors.

E

A

(e) => void

(data) => Result<E, A>

pipe(
  Result.err("not found"),
  Result.tapError(e => console.error("validation failed:", e)),
  Result.chain(save),
)