in the example above, if the example in the middle...
# arrow
b
in the example above, if the example in the middle throws an error, it just doesn't run the next effects
what should I do with use?
I just did put }.bracket(release={ IO { dataset.end() } }, use = { IO { it } })
let me share the current fx solution
I would expect it to close (dataset.end()) executed when the middle effect fails
I tried also to put the Bracket directly on an IO that is around my potentially failing function
IO { println("Executing query ${dataset.running}") executeQuery(query, dataset) }.bracket(release = { println("Releasing") IO { dataset.end() } }, use = { IO { … } }
the release in bracket works well when executeQuery runs properly, but if it fails, it never gets executed
the documentation says that "This would ensure the file gets closed right after completing the use operation, which would be fileToString(file) here. If that operation throws an error, the file would also be closed." with a similar pattern (at least it seems similar to me)
r
Is this with the latest master snapshot?
Master should have those fixes otherwise something is broken in master //cc @simon.vergauwen
b
the master from yesterday