function program(){
Effect.gen(function*($) {
yield* $(function1())
yield* $(function2())
yield* $(lastStep())
// All of this function can fail with different Errors in the Error channel
Effect.catchAll(error => {
return pipe(
Effect.log('Effect have errors'),
() => sendErrorMessage()
() => Effect.interrupt()
() => Effect.log('Execution stopped')
)
})
return true
})
}
function program(){
Effect.gen(function*($) {
yield* $(function1())
yield* $(function2())
yield* $(lastStep())
// All of this function can fail with different Errors in the Error channel
Effect.catchAll(error => {
return pipe(
Effect.log('Effect have errors'),
() => sendErrorMessage()
() => Effect.interrupt()
() => Effect.log('Execution stopped')
)
})
return true
})
}