Rule 135e-task-onerror-fail
Task Reduction
(135)
Referred to from
- The comment on rule
e-task-andthen-fail(Chapter 8) - Section 8.4 Tasks
TeX source
\defnrule[r:e-task-onerror-fail]
{\japp{v}{v'}{\tk}}
{\effonError(v,\efffail\,v')\effred{}\tk}Tests (4)
- elm / MinimalTaskOnErrorTestAn error handler replaces a task that fails.
- elm-core / TaskAttemptErrorTest`Task.attempt` delivers both outcomes to `update` in a `Platform.worker`: `Ok` with the value of a succeeding task and `Err` with the error of a failing one.
- elm-core / TaskOnErrorCascadeTest`Task.onError` recovers a failed `Task.andThen` chain, skipping the steps between the failure and the handler, and the recovered task can be chained further.
- elm-core / TaskOnErrorInnerTest`Task.onError` lets its task take steps before it succeeds or fails.
Discussions
Discuss this rule·Search the discussions on GitHub
Discussions are on GitHub; one about this rule has [r:e-task-onerror-fail] in its title.
A Standard Definition of Elm? (Draft version 0.4) © Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.