Hello guys,While using Swift 2 I got one problem – how to throw inside closure of function. Example:// this func can't be changed and modifiedfunc httpRequest(param:String, completionHTTP:(result:String) -> Void){ completionHTTP(result:some result)}// this func can be changed and modifiedfunc myFunc() throws { httpRequest(param1) { (result) -> Void in throw NSError(domain: MyDomain, code: 0, userInfo: [NSLocalizedDescriptionKey: Error description]) }}myFunc - gives error of invalid conversion from thowing function to non-throwing functionHow can I call throw inside of closure of non-throwing func?
10
0
3.6k