Please enable JavaScript.
Coggle requires JavaScript to display documents.
Promise Chain (Routing (Error Rendering, Success Rendering), Errors…
Promise Chain
-
-
Current
Kickoff
Promise 1
Success
Promise 2
Error
Promise 3 (error path)
Passable Error
-
Pass Err to next Promise
- 1 more item...
-
Success
Promise 3 (success path)
Error
Passable Error
- 2 more items...
Real Error
- 1 more item...
Success
Success from Promise 3
- 1 more item...
-
The final promise/routing layer has to know an awful lot about what happened during Promise 3, which is fine, but hard to follow when its buried. Promise 3 and 4 are also in charge of managing their own state. Also treating error messages as gateways is fine, but harder to follow when wrapped in an immutable object and buried inside various files/helpers, not to mention, early routing can occur with this pattern
Nothing is Buried or nested, everything will resurface to the routing layer at some point. Then we can hand it off however we need to.