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)
87throw 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)
112new WebException(SR.Format(SR.net_requestaborted, WebExceptionStatus.RequestCanceled), WebExceptionStatus.RequestCanceled); 154catch (Exception e) { throw new WebException(e.Message, e); } 214throw new WebException(e.Message, e); 261throw new WebException(SR.net_webstatus_Timeout, WebExceptionStatus.Timeout); 277throw new WebException(SR.net_webstatus_Timeout, WebExceptionStatus.Timeout); 468throw 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)
115throw new WebException(SR.net_ftp_active_address_different, WebExceptionStatus.ProtocolError); 261throw new WebException(SR.net_InvalidStatusCode, WebExceptionStatus.ProtocolError); 568throw new WebException(SR.net_ftp_invalid_uri); 748throw new WebException(SR.net_ftp_active_address_different, WebExceptionStatus.ProtocolError);
System\Net\FtpWebRequest.cs (6)
922SetException(ExceptionDispatchInfo.SetCurrentStackTrace(new WebException(SR.net_timeout, WebExceptionStatus.Timeout))); 941return new WebException(SR.net_webstatus_NameResolutionFailure, WebExceptionStatus.NameResolutionFailure); 945return new WebException(SR.net_webstatus_ConnectFailure, WebExceptionStatus.ConnectFailure); 1107_exception = new WebException(exception.Message, null, ((WebException)exception).Status, _ftpWebResponse); 1116_exception = new WebException(SR.Format(SR.net_ftp_servererror, connection.StatusLine), exception, WebExceptionStatus.ProtocolError, _ftpWebResponse); 1120_exception = new WebException(exception.Message, exception);
System\Net\HttpWebRequest.cs (4)
1261throw new WebException( 1314throw new WebException(SR.CacheEntryNotFound, WebExceptionStatus.CacheEntryNotFound); 1370throw new WebException(SR.CacheEntryNotFound, WebExceptionStatus.CacheEntryNotFound); 1570throw 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);
51 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)
Microsoft.Extensions.Diagnostics.ExceptionSummarization (3)
ExceptionSummarizationBuilderExtensions.cs (1)
17/// Registers a summary provider that handles <see cref="OperationCanceledException"/>, <see cref="WebException"/>, and <see cref="SocketException"/> .
HttpExceptionSummaryProvider.cs (2)
76typeof(WebException), 94case WebException ex:
Microsoft.ML.Core (2)
Utilities\ResourceManagerUtils.cs (2)
294catch (WebException e) 321catch (WebException e)
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)
518catch (WebException)
PresentationFramework (4)
System\Windows\Application.cs (1)
725catch (WebException)
System\Windows\Documents\FixedDocument.cs (1)
963if (!(e is System.Net.WebException || e is System.InvalidOperationException))
System\Windows\Navigation\NavigationService.cs (2)
2710catch (WebException e) 2888catch (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)
111private static WebException CreateRequestAbortedException() =>
System\Net\FtpDataStream.cs (2)
93WebException? webException = exception as WebException;
System\Net\FtpWebRequest.cs (3)
915catch (WebException webException) 1104if (exception is WebException) 1107_exception = new WebException(exception.Message, null, ((WebException)exception).Status, _ftpWebResponse);
System\Net\HttpWebRequest.cs (3)
1060throw WebException.CreateCompatibleException(ex); 1162throw WebException.CreateCompatibleException(ex); 1433throw 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);