private void OnSendAdditionalDataCompleted(object sender, SendAdditionalDataCompletedEventArgs e) { try { if (e.Error != null || e.Cancelled) { SendRequestCompleted?.Invoke(this, new SendRequestCompletedEventArgs(null, e.Error, e.Cancelled)); } Response response = e.Result; if (response is ErrorResponse errorResponse) { throw new Exception(errorResponse.Error); } SendRequestCompleted?.Invoke(this, new SendRequestCompletedEventArgs(response, null, false)); } catch (Exception ex) { SendRequestCompleted?.Invoke(this, new SendRequestCompletedEventArgs(null, ex, false)); } }
private void OnSendAdditionalDataCompleted(object sender, SendAdditionalDataCompletedEventArgs e) { try { if (e.Error != null || e.Cancelled) SendRequestCompleted(this, new SendRequestCompletedEventArgs(null, e.Error, e.Cancelled)); Response response = e.Result; var errorResponse = response as ErrorResponse; if (errorResponse != null) throw new Exception(errorResponse.Error); SendRequestCompleted(this, new SendRequestCompletedEventArgs(response, null, false)); } catch (Exception ex) { SendRequestCompleted(this, new SendRequestCompletedEventArgs(null, ex, false)); } }