52 instantiations of WebException
dotnet-svcutil-lib (1)
Metadata\MetadaExchangeResolver.cs (1)
293throw new WebException(errorMsg, null, WebExceptionStatus.ProtocolError, webResponse);
Microsoft.Build.Tasks.UnitTests (1)
DownloadFile_Tests.cs (1)
217throw new WebException("Error", WebExceptionStatus.ReceiveFailure);
PresentationCore (7)
MS\Internal\WpfWebRequestHelper.cs (1)
88throw new WebException(requestUri.ToString(), WebExceptionStatus.RequestCanceled);
System\IO\Packaging\PackWebRequest.cs (3)
140throw new WebException(SR.ResourceNotFoundUnderCacheOnlyPolicy); 150throw new WebException(SR.PackWebRequestCachePolicyIllegal); 216throw new WebException(SR.PackWebRequestCachePolicyIllegal);
System\IO\Packaging\PackWebResponse.cs (3)
243throw new WebException(SR.WebResponsePartNotFound); 863throw new WebException(SR.WebResponseFailure); 901_responseException = new WebException(SR.Format(SR.WebRequestTimeout, null), WebExceptionStatus.Timeout);
System.Net.HttpListener (1)
System\Net\Managed\ChunkStream.cs (1)
392WebException we = new WebException(message, null, WebExceptionStatus.ServerProtocolViolation, null);
System.Net.Requests (28)
System\Net\CommandStream.cs (3)
135return new WebException( 144return new WebException(SR.Format(SR.net_ftp_servererror, NetRes.GetWebStatusCodeString(code, statusDescription)), 317exception = new WebException(_abortReason);
System\Net\ExceptionHelper.cs (2)
10internal static WebException RequestAbortedException => new WebException(SR.net_reqaborted); 12internal static WebException TimeoutException => new WebException(SR.net_timeout);
System\Net\FileWebRequest.cs (6)
110new WebException(SR.Format(SR.net_requestaborted, WebExceptionStatus.RequestCanceled), WebExceptionStatus.RequestCanceled); 152catch (Exception e) { throw new WebException(e.Message, e); } 212throw new WebException(e.Message, e); 259throw new WebException(SR.net_webstatus_Timeout, WebExceptionStatus.Timeout); 275throw new WebException(SR.net_webstatus_Timeout, WebExceptionStatus.Timeout); 466throw new WebException(SR.Format(SR.net_requestaborted, WebExceptionStatus.RequestCanceled), WebExceptionStatus.RequestCanceled);
System\Net\FileWebResponse.cs (1)
45throw new WebException(e.Message, e, WebExceptionStatus.ConnectFailure, null);
System\Net\FtpControlStream.cs (4)
112throw new WebException(SR.net_ftp_active_address_different, WebExceptionStatus.ProtocolError); 244throw new WebException(SR.net_InvalidStatusCode, WebExceptionStatus.ProtocolError); 539throw new WebException(SR.net_ftp_invalid_uri); 719throw new WebException(SR.net_ftp_active_address_different, WebExceptionStatus.ProtocolError);
System\Net\FtpWebRequest.cs (6)
919SetException(ExceptionDispatchInfo.SetCurrentStackTrace(new WebException(SR.net_timeout, WebExceptionStatus.Timeout))); 938return new WebException(SR.net_webstatus_NameResolutionFailure, WebExceptionStatus.NameResolutionFailure); 942return new WebException(SR.net_webstatus_ConnectFailure, WebExceptionStatus.ConnectFailure); 1104_exception = new WebException(exception.Message, null, ((WebException)exception).Status, _ftpWebResponse); 1113_exception = new WebException(SR.Format(SR.net_ftp_servererror, connection.StatusLine), exception, WebExceptionStatus.ProtocolError, _ftpWebResponse); 1117_exception = new WebException(exception.Message, exception);
System\Net\HttpWebRequest.cs (4)
1259throw new WebException( 1312throw new WebException(SR.CacheEntryNotFound, WebExceptionStatus.CacheEntryNotFound); 1368throw new WebException(SR.CacheEntryNotFound, WebExceptionStatus.CacheEntryNotFound); 1568throw new WebException(SR.net_reqaborted, WebExceptionStatus.RequestCanceled);
System\Net\WebException.cs (2)
85return new WebException( 93return new WebException(
System.Net.WebClient (14)
System\Net\WebClient.cs (14)
312throw new WebException(SR.net_webclient, e); 342throw new WebException(SR.net_webclient, e); 377throw new WebException(SR.net_webclient, e); 415throw new WebException(SR.net_webclient, e); 467throw new WebException(SR.net_webclient, e); 489throw new WebException(SR.net_webclient_Multipart); 582throw new WebException(SR.net_webclient, e); 597throw new WebException(SR.net_webclient_ContentType); 647throw new WebException(SR.net_webclient, e); 839throw new WebException(SR.net_webstatus_MessageLengthLimitExceeded, WebExceptionStatus.MessageLengthLimitExceeded); 863throw new WebException(SR.net_webclient, e); 886throw new WebException(SR.net_webstatus_MessageLengthLimitExceeded, WebExceptionStatus.MessageLengthLimitExceeded); 1000throw new WebException(SR.net_webclient, e); 1527e is WebException || e is SecurityException ? e : new WebException(SR.net_webclient, e);
46 references to WebException
dotnet-openapi (1)
Commands\BaseCommand.cs (1)
329if (exception is HttpRequestException || exception is WebException)
dotnet-svcutil-lib (8)
CmdCredentialsProvider.cs (1)
23public NetworkCredential GetCredentials(Uri serviceUri, WebException webException)
Metadata\HttpAuthenticationHelper.cs (4)
33public static HttpWebResponse GetUnauthorizedResponse(WebException webException) 42webException = GetException<WebException>(webException.InnerException); 50public static HttpWebResponse GetForbiddenResponse(WebException webException) 60webException = GetException<WebException>(webException.InnerException);
Metadata\IHttpCredentialsProvider.cs (1)
12NetworkCredential GetCredentials(Uri serviceUri, WebException webException);
Metadata\MetadaExchangeResolver.cs (2)
306WebException webException = HttpAuthenticationHelper.GetException<WebException>(exception);
Microsoft.AspNetCore.Http.Connections.Client (1)
Internal\LongPollingTransport.cs (1)
169catch (WebException ex) when (!OperatingSystem.IsBrowser() && ex.Status == WebExceptionStatus.RequestCanceled)
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Common\RetryHelper.cs (1)
56if (exception is HttpRequestException || exception is WebException)
Microsoft.Build.Tasks.Core (1)
DownloadFile.cs (1)
287if (actualException is WebException webException)
netstandard (1)
netstandard.cs (1)
1301[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Net.WebException))]
PresentationCore (3)
MS\Internal\Text\TextInterface\DWriteUtil.cs (1)
56if (e is System.Net.WebException)
System\IO\Packaging\PackWebResponse.cs (1)
796catch (WebException e)
System\Windows\Media\ColorContext.cs (1)
522catch (WebException)
PresentationFramework (4)
System\Windows\Application.cs (1)
722catch (WebException)
System\Windows\Documents\FixedDocument.cs (1)
963if (!(e is System.Net.WebException || e is System.InvalidOperationException))
System\Windows\Navigation\NavigationService.cs (2)
2712catch (WebException e) 2890catch (WebException e)
ReachFramework (1)
Serialization\ImageSourceTypeConverter.cs (1)
249catch (WebException)
System (1)
src\libraries\shims\System\ref\System.cs (1)
791[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Net.WebException))]
System.Net (1)
System.Net.cs (1)
51[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Net.WebException))]
System.Net.HttpListener (1)
System\Net\Managed\ChunkStream.cs (1)
392WebException we = new WebException(message, null, WebExceptionStatus.ServerProtocolViolation, null);
System.Net.Requests (12)
System\Net\CommandStream.cs (1)
544if (e is WebException)
System\Net\ExceptionHelper.cs (2)
10internal static WebException RequestAbortedException => new WebException(SR.net_reqaborted); 12internal static WebException TimeoutException => new WebException(SR.net_timeout);
System\Net\FileWebRequest.cs (1)
109private static WebException CreateRequestAbortedException() =>
System\Net\FtpDataStream.cs (2)
90WebException? webException = exception as WebException;
System\Net\FtpWebRequest.cs (3)
912catch (WebException webException) 1101if (exception is WebException) 1104_exception = new WebException(exception.Message, null, ((WebException)exception).Status, _ftpWebResponse);
System\Net\HttpWebRequest.cs (3)
1058throw WebException.CreateCompatibleException(ex); 1160throw WebException.CreateCompatibleException(ex); 1431throw WebException.CreateCompatibleException(ex);
System.Net.WebClient (10)
System\Net\WebClient.cs (10)
311if (e is WebException || e is SecurityException) throw; 341if (e is WebException || e is SecurityException) throw; 376if (e is WebException || e is SecurityException) throw; 414if (e is WebException || e is SecurityException) throw; 466if (e is WebException || e is SecurityException) throw; 581if (e is WebException || e is SecurityException) throw; 646if (e is WebException || e is SecurityException) throw; 862if (e is WebException || e is SecurityException) throw; 999if (e is WebException || e is SecurityException) throw; 1527e is WebException || e is SecurityException ? e : new WebException(SR.net_webclient, e);