ARTICLE AD BOX
During a pre-interview call with a company, I got asked a couple questions about swift concurrency. One of the questions was:
When using for try await to iterate through an async sequence, how do you deal with errors in a way that one failure doesn't stop the entire sequence?
But if you put for try await in a do/catch block, doesn't that cause the whole thing to throw when one thing in the sequence throws? To not have it stop the whole sequence, you'd have to refactor it so that you can put do/catch inside of the loop, right? Or am I missing something?
I want to be able to handle this when I get to my actual interview this week if it comes up and they ask me about it. Thanks!
