In your first code sample, I'm pretty sure you don't need the return await GetSession (provider, isLast, options, token);
Unless there's more to the method, just remove the async modifier and directly return the task returned by GetSession.
Unless there's more to the method, just remove the async modifier and directly return the task returned by GetSession.
Instead, it unwraps exceptions, and while it propagates cancelations, it ignores other exceptions and tries other providers in turn.
In fact, I could even use `break` or `continue` in the midst of async code, and there would be no problem.
Also I just love using `try` and `finally` in async code—with callbacks, you have to do finalization from all error and success paths (which can be a lot of places).