[Beginner question] Building a Program with Async Functions and Error Logging
Happy beginner with everything Effect and functional programming
I'm struggling with figuring out how to build up my program. What I want is basically this:
* Run async f1 with an input
* If f1 succeeds, run async f2 (with result of f1 as input)
* If f1 or f2 fails, log errors with a custom message
* Log info when both f1 and f2 starts and ends
I'm currently at this:
I would like to be able to code the happy path first, and then handle the errors. But with this code the program blows up when f1 or f2 fails, and errors don't get caught at all.
Could anyone give point me in the right direction?
I'm struggling with figuring out how to build up my program. What I want is basically this:
* Run async f1 with an input
* If f1 succeeds, run async f2 (with result of f1 as input)
* If f1 or f2 fails, log errors with a custom message
* Log info when both f1 and f2 starts and ends
I'm currently at this:
I would like to be able to code the happy path first, and then handle the errors. But with this code the program blows up when f1 or f2 fails, and errors don't get caught at all.
Could anyone give point me in the right direction?
