The Either monad is a very nice solution for this in my opinion, in Haskell it's just
do bar
baz
bazz
with it immediately returning after the first error value it encounters or returning the actual result (this is also how Rust solves it, though they introduce specific syntactic sugar for it rather than an universal monadic sugar).