Skip to content

tapError

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

Defined in: Core/TaskResult.ts:163

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

E

A

(e) => void

(data) => TaskResult<E, A>

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