src/Simple.OData.Client.Core/Http/WebRequestException.cs
/// <summary>
/// Creates from the instance of WebException.
/// </summary>
/// <param name="ex">The instance of <see cref="WebException"/>.</param>
/// <param name="exceptionMessageSource">The source used to build exception message, see <see cref="WebRequestExceptionMessageSource"/></param>
/// <returns>The instance of <see cref="WebRequestException"/>.</returns>
Creates from the instance of WebException.
Creates from the instance of WebException .
public static WebRequestException CreateFromWebException(WebException ex, WebRequestExceptionMessageSource exceptionMessageSource = WebRequestExceptionMessageSource.ReasonPhrase)
	{
		return ex.Response is not HttpWebResponse response ?
			new WebRequestException(ex) :
			new WebRequestException(ex.Message, response.StatusCode, response.ResponseUri, Utils.StreamToString(response.GetResponseStream()), exceptionMessageSource, ex);
	}
public static WebRequestException CreateFromWebException ( WebException ex , WebRequestExceptionMessageSource exceptionMessageSource = WebRequestExceptionMessageSource . ReasonPhrase ) { return ex . Response is not HttpWebResponse response ? new WebRequestException ( ex ) : new WebRequestException ( ex . Message , response . StatusCode , response . ResponseUri , Utils . StreamToString ( response . GetResponseStream ( ) ) , exceptionMessageSource , ex ) ; }
Creates from the instance of WebException.
Creates from the instance of WebException .
The instance of .
The instance of .
ex
WebException
The instance of .
The instance of .
exceptionMessageSource
WebRequestExceptionMessageSource
The source used to build exception message, see
The source used to build exception message see