BoltsFramework / Bolts-ObjC

Bolts is a collection of low-level libraries designed to make developing mobile apps easier.
Other
5.65k stars 578 forks source link

setException deprecated #328

Open wolfAle opened 5 years ago

wolfAle commented 5 years ago

Hi guys,

I'm working on an old codebase and we have many warnings about: 'exception' is deprecated: 'BFTask' exception handling is deprecated and will be removed in a future It happens in cases like this:

@try {
        [[ILRLogin sharedManager] activeWithServer:server];
        LRSession *session = [[ILRLogin sharedManager] getAuthSession];
        [session onSuccess:^(id result) {
           ............
        } onFailure:^(NSError *err) {
           ............
        }];        
    } @catch (NSException *exception) {
        [task setException:exception]; --> HERE
    }

or even in the caller, where I check if(task.exception). I googled a lot but I couldn't find advices about what to do instead. Is there a replacement method? Should I just ignore the exception in the catch block? Can you please point me in the right direction here?

Thanks, Alessandro