System.Net.HttpWebRequest.HttpWebRequest.SetWriteStreamError C# (CSharp) Method

SetWriteStreamError() private method

private SetWriteStreamError ( WebExceptionStatus status, Exception exc ) : void
status WebExceptionStatus
exc Exception
return void
		internal void SetWriteStreamError (WebExceptionStatus status, Exception exc)
		{
			if (Aborted)
				return;

			WebAsyncResult r = asyncWrite;
			if (r == null)
				r = asyncRead;

			if (r != null) {
				string msg;
				WebException wex;
				if (exc == null) {
					msg = "Error: " + status;
					wex = new WebException (msg, status);
				} else {
					msg = String.Format ("Error: {0} ({1})", status, exc.Message);
					wex = new WebException (msg, exc, status);
				}
				r.SetCompleted (false, wex);
				r.DoCallback ();
			}
		}