Skip to content

tapError

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

Defined in: Core/TaskResult.ts:146

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

E

A

(e) => void

(data) => TaskResult<E, A>

pipe(
  fetchUser(id),
  TaskResult.tapError(e => console.error("fetch failed:", e)),
  TaskResult.chain(saveToCache),
)