问题:
我有以下显示警告的功能No calls to throwing functions occur within 'try' expression
问题:
- 为什么显示此警告?(任务里面的代码会报错)
- 我应该怎么做才能将错误传播给调用者
f1
?
代码:
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()
}
}
}