Problem:
I have the following function which shows a warning No calls to throwing functions occur within 'try' expression
Questions:
- Why is this warning shown? (The code inside the task throws an error)
- What should I do to propagate the error to the caller of
f1
?
Code:
func f1() async throws {
try await withThrowingTaskGroup(of: Int.self) { group in //No calls to throwing functions occur within 'try' expression
group.addTask(priority: .high) {
throw NSError()
}
}
}