private async void DoSomething() { log($"start DoSomething (processresult Thread: {getCurrentThreadInfo()})"); var externalCall = new ExternalCall(3000); var result = await externalCall.LongActionWithError().ConfigureAwait(false); // error will be thrown in Secondary Thread + the Main UI will silently shut down //log($"continue DoSomething (processresult Thread: {getCurrentThreadInfo()})"); }
private async Task <string> processResultWithError() { var externalCall = new ExternalCall(3000); log($"start ExternalCall (processresult Thread: {getCurrentThreadInfo()})"); var result = await externalCall.LongActionWithError().ConfigureAwait(false); // it will throw error, because a secondary Thread will process remaining code (in this function) //log($"ExternalCall returns: {result}. (processresult Thread: {getCurrentThreadInfo()})"); return(result + " (Processed by processresult(). Thread after await externalCall: {getCurrentThreadInfo()})"); }