private PayloadData TryAsyncContinuation(Task <ArraySegment <byte> > task) { if (task.IsFaulted) { SetFailed(); } var payload = new PayloadData(task.GetAwaiter().GetResult()); payload.ThrowIfError(); return(payload); }
private PayloadData TryAsyncContinuation(Task <ArraySegment <byte> > task) { if (task.IsFaulted) { SetFailed(); } ArraySegment <byte> bytes; try { bytes = task.GetAwaiter().GetResult(); } catch (MySqlException ex) when(ex.Number == (int)MySqlErrorCode.CommandTimeoutExpired) { HandleTimeout(); throw; } var payload = new PayloadData(bytes); payload.ThrowIfError(); return(payload); }